3 ms·
> That's not true for Java. Its generational garbage collector performs bump allocation in the nursery, yielding tightly packed objects with excellent cache beh
by geodel 10y ago
> That's not true for Java. Its generational garbage collector performs bump allocation in the nursery, yielding tightly packed objects with excellent cache behavior. Allocation in HotSpot is like 3-5 instructions (really!)
When I see this link I get different impression.
http://mechanical-sympathy.blogspot.com/2012/10/compact-off-heap-structurestuples-in.html http://mechanical-sympathy.blogspot.com/2012/10/compact-off-...
It is only heavy use of sun.misc.Unsafe and unidiomatic coding style that give Java semblance of memory efficiency.
- pcwalton 10y agoThat post's numbers are entirely based a giant multi-gigabyte long-lived array: the classic worst case for a generational GC. That is not representative of most memory allocations. The generational hypothesis, which has been empirically verified in real world code again and again, is that most allocations are short-lived and small.
- geodel 10y agoThere were 3 points mentioned in post with only 1 about GC. Performance and memory efficiency were major points not delivered by standard idiomatic Java code. Considering the popularity of memory compact Java collections like Fastutils etc I feel that memory bloat of standard Java is very common issue plaguing Java applications.
- pcwalton 10y agoIf you read the comments, you'll find that the issue is in fact GC: specifically, the cost of tenuring objects.