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: [email protected] For additional commands, e-mail: [email protected]
