JEP 248: Make G1 the Default Garbage Collector

Andrew Haley aph at redhat.com
Fri Jul 31 08:32:35 UTC 2015


Hi,

On 30/07/15 19:04, charlie hunt wrote:
> On javac, my observation is that it tends to have a very high object
> allocation rate, and the object lifetimes are somewhat short.  And,
> I suppose if we think about what javac does, I suppose we can come
> to terms as to why that’s the case. I imagine if one put forth a
> concerted effort, javac could be improved (probably true for many
> apps too).

Maybe.  IME compilers tend to have a bimodal distribution of object
lifetimes, very long-lived (until process termination) and very
short-lived, and it's fairly obvious why this should be.

[As an aside: years ago GCC used a special-purpose region-based manual
memory allocator (probably based on this bimodal distribution) which
created "obstacks" for different purposes.  In theory this is ideal,
but in practice frequently led to "obstack hell" where an object was
allocated in one region but a change to the compiler meant it was
deallocated while still live.  Nowadays GCC uses a garbage collector,
but there was a lot of resistance to the change.  GCC is definitely
slower as a result, but it was surely worth it.]

> I also like your comments on being prepared to answer / respond to
> observations that “J. Random Blogger” claims that Java just got
> slower. Completely agree with you!

Nonsense spreads around the Internet like wildfire, and we have to be
ready with a rapid rebuttal.

Andrew.


More information about the hotspot-dev mailing list