jerrypeng commented on a change in pull request #4104: Reduce memory used in 
ClientCnx for pending lookups
URL: https://github.com/apache/pulsar/pull/4104#discussion_r277475572
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
 ##########
 @@ -154,9 +155,9 @@ public ClientCnx(ClientConfigurationData conf, 
EventLoopGroup eventLoopGroup) {
     public ClientCnx(ClientConfigurationData conf, EventLoopGroup 
eventLoopGroup, int protocolVersion) {
         super(conf.getKeepAliveIntervalSeconds(), TimeUnit.SECONDS);
         checkArgument(conf.getMaxLookupRequest() > 
conf.getConcurrentLookupRequest());
-        this.pendingLookupRequestSemaphore = new 
Semaphore(conf.getConcurrentLookupRequest(), true);
-        this.waitingLookupRequests = Queues
-            .newArrayBlockingQueue((conf.getMaxLookupRequest() - 
conf.getConcurrentLookupRequest()));
+        this.pendingLookupRequestSemaphore = new 
Semaphore(conf.getConcurrentLookupRequest(), false);
+        this.maxLookupRequestSemaphore = new 
Semaphore(conf.getMaxLookupRequest(), false);
 
 Review comment:
   conf.getMaxLookupRequest() - conf.getConcurrentLookupRequest()

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to