lukecwik commented on code in PR #25300:
URL: https://github.com/apache/beam/pull/25300#discussion_r1096078434


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/util/UnboundedScheduledExecutorService.java:
##########
@@ -17,6 +17,7 @@
  */
 package org.apache.beam.sdk.util;
 
+import static java.util.concurrent.TimeUnit.MILLISECONDS;

Review Comment:
   ```suggestion
   import static java.util.concurrent.TimeUnit.HOURS;
   import static java.util.concurrent.TimeUnit.MILLISECONDS;
   ```



##########
sdks/java/core/src/main/java/org/apache/beam/sdk/util/UnboundedScheduledExecutorService.java:
##########
@@ -201,9 +200,26 @@ public UnboundedScheduledExecutorService() {
         new ThreadPoolExecutor(
             0,
             Integer.MAX_VALUE, // Allow an unlimited number of re-usable 
threads.
-            Long.MAX_VALUE,
-            TimeUnit.NANOSECONDS, // Keep non-core threads alive forever.
-            new SynchronousQueue<>(),
+            // Put a high-timeout on non-core threads. This reduces memory for 
per-thread caches
+            // over time.
+            1,
+            TimeUnit.HOURS,

Review Comment:
   ```suggestion
               HOURS,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to