File tree Expand file tree Collapse file tree
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -432,6 +432,7 @@ public static final class Builder {
432432 private static final Duration MIN_ACK_EXPIRATION_PADDING = Duration .ofMillis (100 );
433433 private static final Duration DEFAULT_ACK_EXPIRATION_PADDING = Duration .ofMillis (500 );
434434 private static final Duration DEFAULT_MAX_ACK_EXTENSION_PERIOD = Duration .ofMinutes (60 );
435+ private static final long DEFAULT_MEMORY_PERCENTAGE = 20 ;
435436
436437 static final ExecutorProvider DEFAULT_EXECUTOR_PROVIDER =
437438 InstantiatingExecutorProvider .newBuilder ()
@@ -449,7 +450,8 @@ public static final class Builder {
449450
450451 FlowControlSettings flowControlSettings =
451452 FlowControlSettings .newBuilder ()
452- .setMaxOutstandingRequestBytes (Runtime .getRuntime ().maxMemory () / 5 )
453+ .setMaxOutstandingRequestBytes (
454+ Runtime .getRuntime ().maxMemory () * DEFAULT_MEMORY_PERCENTAGE / 100L )
453455 .build ();
454456
455457 ExecutorProvider executorProvider = DEFAULT_EXECUTOR_PROVIDER ;
You can’t perform that action at this time.
0 commit comments