views:

1178

answers:

3

I'd like to know what are the experiences with G1 garbage collector in newest JDK? I see NullPointerException thrown in my program, although code didn't change and behave correctly in earlier JDKs.

+1  A: 

I've been running jEdit using:

-Xmx192M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC

for the last couple of days on windows. Haven't experienced anything going wrong or misbehaving.

I also tried running Intellij using the G1 GC, it didn't fair so well. It lasted a couple of hours before crashing in a big pile of mess, a bit optimistic maybe.

Gareth Davis
+1  A: 

I tried and experienced no exceptions. But performance of our server dropped about 30%.

Vitaly
That's disappointing that you saw such a significant performance degradation, but it's important to remember that an important goal of the G1 collector is to minimize pauses. With a heap of a few GB or higher, you can get multiple minute pauses when GC runs with the other collectors. So, even if G1 leads to somewhat longer response times, as long as they are more consistent and never exhibit the worst-case behavior, that would be a great improvement for some apps.
Matt Passell
+3  A: 

A garbage collector will only impact the performance of your application, not its correctness. I've been using it for Eclipse, just for fun, and seemed stable.

I would look elsewhere for the source of the exceptions.

Robert Munteanu
A bug in garbage collector, on the other hand, *can* impact its correctness. Something about "experimental" tells me it's not completely unreasonable to question the situation. :)
280Z28
I agree that it is experimental and I would not use it production, at least not with u14.
Robert Munteanu