hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vigna <vi...@di.unimi.it>
Subject Re: AbstractNIOConnPool memory leak?
Date Tue, 25 Dec 2012 05:01:47 GMT
Well, actually not. I did a careful port-mortem analysis using the Eclipse
Memory Analyzer, and, simply, the map is very huge. There are more than one
million entry, and each entry uses approximately 256 bytes for connections
and routes.

Much of this space is unfortunately overhead of java'util's data structures.
HashMap and HashSet are essentially unusable in any situation in which
memory footprint is relevant. The space used by an entry (48 bytes) is
comparable to the data you're storing.

Replacing HashSet/HashMap with fastutil's
ObjectOpenHashSet/ObjectOpenHashMap or similar structures based on open
hashing would, I believe, half the memory footprint. They're slightly
slower, but their overhead is an order of magnitude smaller.

View this message in context: http://httpcomponents.10934.n7.nabble.com/AbstractNIOConnPool-memory-leak-tp18554p18567.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message