> However, pooling objects whose creation or initialization incur > additional costs beyond simple memory allocation--such as database > connections, threads, and network connections--is still a major win.
Pools are also still useful when used to optimize for something other than speed (managing a scarce resource, for example). > There is also evidence that pooling simply to avoid the cost of memory > allocation provides major benefits in programs that use many threads > running on multiple processors. I also wonder about how the HotSpot team approaches garbage collection now. It seems like the allocator is now really fast, but not pooling objects seems like it would necessarily result in the GC getting called more often. This makes me wonder what the amortized cost is. No doubt it is still faster than pooling, but it would be interesting to see analysis on it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
