4 ms·
Well, it is solved, but it is still not free. Java uses something called TLABs (thread local allocation buffer) which are basically arena allocators where a ne
by kaba0 4y ago
Well, it is solved, but it is still not free.
Java uses something called TLABs (thread local allocation buffer) which are basically arena allocators where a new object creation is a pointer bump (no need to even synchronize!). Later the GC will move longer-lived objects to a more permanent location, reusing the whole buffer for basically free.