我使用apache httpasyncclient 4.1,在jconsole中,我发现直接内存不断增长,我试过强制gc,不行。
令我困惑的是我不使用DirectByteBufferAllocator。
ManagedNHttpClientConnectionFactory connFactory = new ManagedNHttpClientConnectionFactory(null,
null, HeapByteBufferAllocator.INSTANCE);
connManager = new PoolingNHttpClientConnectionManager(ioreactor, connFactory,
socketFactoryRegistry, new DNSResolverWithCache(dnsCache));
我还grep httpclient httpasynclient httpcore httpcore-nio的源代码,只在DirectByteBufferAllocator中有方法allocateDirect(1024)。
任何人都可以帮助我吗?