File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
google-cloud-spanner/src/main/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -390,11 +390,14 @@ public ReadOnlyTransaction readOnlyTransaction(TimestampBound bound) {
390390
391391 /**
392392 * It is enough with one executor to maintain the multiplexed sessions in all the clients, as they
393- * do not need to be updated often, and the maintenance task is light.
393+ * do not need to be updated often, and the maintenance task is light. The core pool size is set
394+ * to 1 to prevent continuous creating and tearing down threads, and to avoid high CPU usage when
395+ * running on Java 8 due to <a href="https://bugs.openjdk.org/browse/JDK-8129861">
396+ * https://bugs.openjdk.org/browse/JDK-8129861</a>.
394397 */
395398 private static final ScheduledExecutorService MAINTAINER_SERVICE =
396399 Executors .newScheduledThreadPool (
397- /* corePoolSize = */ 0 ,
400+ /* corePoolSize = */ 1 ,
398401 ThreadFactoryUtil .createVirtualOrPlatformDaemonThreadFactory (
399402 "multiplexed-session-maintainer" , /* tryVirtual = */ false ));
400403
You can’t perform that action at this time.
0 commit comments