librelist archives

« back to archive

G1 garbage collector

G1 garbage collector

From:
Phil Hagelberg
Date:
2014-03-07 @ 19:12
Hello folks.

We recently had someone point out on IRC that the G1 garbage collector
might be a better fit for Leiningen projects since it can return unused
memory back to the OS, which would be handy for people who keep a number
of Leiningen repls up at a time.

The one hesitation I have is that the G1 GC is only fully-supported on
Java 7 update 4. It has existed for a long time, but in Java 6 it was
just experimental. I'm not sure what the effect of enabling it by
default across the board would be--was it experimental because it was
new or because it had real problems that were addressed in 7?

I'm thinking the best approach might be to use the default GC for
Leiningen's own GC since we don't know what version of Java we're
running inside bin/lein. But if we determine that we're running Java 7
From Leiningen itself, we can assume that it's safe to turn on G1 for
the project JVM. (Technically we can use a different JVM for the project
vs Leiningen, but it's a decent heuristic; if people are doing something
fancy they can override :jvm-opts.)

Anyway, does anyone have any experience or strong opinions about G1?

thanks,
Phil

Re: [leiningen] G1 garbage collector

From:
Stuart Sierra
Date:
2014-03-07 @ 22:15
I have heard anecdotally that G1 had pretty serious bugs on Java 6.


On Fri, Mar 7, 2014 at 2:12 PM, Phil Hagelberg <phil@hagelb.org> wrote:

>
> Hello folks.
>
> We recently had someone point out on IRC that the G1 garbage collector
> might be a better fit for Leiningen projects since it can return unused
> memory back to the OS, which would be handy for people who keep a number
> of Leiningen repls up at a time.
>
> The one hesitation I have is that the G1 GC is only fully-supported on
> Java 7 update 4. It has existed for a long time, but in Java 6 it was
> just experimental. I'm not sure what the effect of enabling it by
> default across the board would be--was it experimental because it was
> new or because it had real problems that were addressed in 7?
>
> I'm thinking the best approach might be to use the default GC for
> Leiningen's own GC since we don't know what version of Java we're
> running inside bin/lein. But if we determine that we're running Java 7
> >From Leiningen itself, we can assume that it's safe to turn on G1 for
> the project JVM. (Technically we can use a different JVM for the project
> vs Leiningen, but it's a decent heuristic; if people are doing something
> fancy they can override :jvm-opts.)
>
> Anyway, does anyone have any experience or strong opinions about G1?
>
> thanks,
> Phil
>

Re: [leiningen] G1 garbage collector

From:
Sean Corfield
Date:
2014-03-07 @ 22:20
On Mar 7, 2014, at 2:15 PM, Stuart Sierra <mail@stuartsierra.com> wrote:
> I have heard anecdotally that G1 had pretty serious bugs on Java 6.

Likewise (and we could confirm this by browsing the Java bug base I'm 
sure) but G1 is excellent with long-lived server processes on Java 7 - 
based on what we've seen at World Singles - so I'd be perfectly happy for 
Leiningen to turn that on by default if it detects Java 7.

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)


Re: [leiningen] G1 garbage collector

From:
Phil Hagelberg
Date:
2014-03-25 @ 20:39
Sean Corfield writes:

> On Mar 7, 2014, at 2:15 PM, Stuart Sierra <mail@stuartsierra.com> wrote:
>> I have heard anecdotally that G1 had pretty serious bugs on Java 6.
>
> Likewise (and we could confirm this by browsing the Java bug base I'm
> sure) but G1 is excellent with long-lived server processes on Java 7 -
> based on what we've seen at World Singles - so I'd be perfectly happy
> for Leiningen to turn that on by default if it detects Java 7.

Supposedly now with Java 8 you get G1 enabled by default, so I think
rather than add complicated logic around this I'll just let people get
the benefit of G1 by updating their JDK instead.

Thanks for the feedback.

-Phil

Re: [leiningen] G1 garbage collector

From:
Gmail
Date:
2014-03-26 @ 04:20
Good call. Another potential issue could be inequity in platforms (e.g. 
Win v.s. Linux). I think they're much more on par than they used to be in 
the past, but issues could arise in the future.  So if you stick with 
whatever they feel is the safest default, then I think it will work more 
smoothly in different environments over time. 

I also think it might be worth putting a note in the docs about how to 
experiment with it for people who might be unable to upgrade, and may be 
unaware that it's worth experimenting with. 

Sent from my iPhone

> On Mar 25, 2014, at 4:39 PM, Phil Hagelberg <phil@hagelb.org> wrote:
> 
> 
> Sean Corfield writes:
> 
>>> On Mar 7, 2014, at 2:15 PM, Stuart Sierra <mail@stuartsierra.com> wrote:
>>> I have heard anecdotally that G1 had pretty serious bugs on Java 6.
>> 
>> Likewise (and we could confirm this by browsing the Java bug base I'm
>> sure) but G1 is excellent with long-lived server processes on Java 7 -
>> based on what we've seen at World Singles - so I'd be perfectly happy
>> for Leiningen to turn that on by default if it detects Java 7.
> 
> Supposedly now with Java 8 you get G1 enabled by default, so I think
> rather than add complicated logic around this I'll just let people get
> the benefit of G1 by updating their JDK instead.
> 
> Thanks for the feedback.
> 
> -Phil

Re: [leiningen] G1 garbage collector

From:
Lee Hinman
Date:
2014-03-07 @ 22:20
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/7/14, 12:12 PM, Phil Hagelberg wrote:
> 
> Hello folks.
> 
> We recently had someone point out on IRC that the G1 garbage
> collector might be a better fit for Leiningen projects since it can
> return unused memory back to the OS, which would be handy for
> people who keep a number of Leiningen repls up at a time.
> 
> The one hesitation I have is that the G1 GC is only fully-supported
> on Java 7 update 4. It has existed for a long time, but in Java 6
> it was just experimental. I'm not sure what the effect of enabling
> it by default across the board would be--was it experimental
> because it was new or because it had real problems that were
> addressed in 7?
> 
> I'm thinking the best approach might be to use the default GC for 
> Leiningen's own GC since we don't know what version of Java we're 
> running inside bin/lein. But if we determine that we're running
> Java 7
>> From Leiningen itself, we can assume that it's safe to turn on G1
>> for
> the project JVM. (Technically we can use a different JVM for the
> project vs Leiningen, but it's a decent heuristic; if people are
> doing something fancy they can override :jvm-opts.)
> 
> Anyway, does anyone have any experience or strong opinions about
> G1?
> 
> thanks, Phil

I would recommend only making this a default change with a major
version bump, simply because a lot of people use leiningen to
benchmark their code (for better or worse), and changing garbage
collectors in a minor release could be confusing when comparing
benchmarks.

;; Lee

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTGkYaAAoJEJ1kZdQ6zsrg738P/0E2nb2zFKWFzEyBr4DQbWFW
KDn98L0B0wZWlnCxiFxjKgwloKRtaPGqICcsCLRfxfVbX3dP1f1s2jZMEL+Gs4jS
GrVig5YmgK1WAR4obq/pX0OLvsAxkwoBSS3KaJaBHRZv7n8zM9K2NFr+2VmiTc5t
lfqWte2WOnzcPjNzG0CjySV7eLyMDcLAyLF+C4LEv+9hwXy8HnwZTMZPRPrK0NhB
nOIXHXEWT9hwyfRdstDCqzkcxojCZpBC6e77k2LGbTk7TjnIh2t6suMVsq1U1CV3
d2tXWRmye3ylhO8LbTV/A9CTKywN9j+8FcatqqKsTbDltD/djXov9DDRl4akZVJZ
Qsc/7ms8d09cf0s4ILbnw8D7IRud32qTJhio1aEw3OKRgnkDgEG3mNUpYXC9Q9an
dtb3TOtbgr0bL6pVTIEIZL8jd7Agja3b4WnCJ6IQYrQ9DxHDSBg6bzIrNUKOZ7vC
wZFtUpoPIyesj/Q4E2x6XJU+q/Se8t5rSfpC50JxPtATS2a+2KzVLmWmxH3roh/l
1OAyvHc/mSnTTBeuwffR77lV9Y82TzNf3Y/TYmu4DaVQu6w5O/S/abCzF3NWLWB1
unNpYpOVtz5zxl7NPyUBCM9f49sQY5WSWtP1s6ygWcoGMyeYDtUOZ9ZQ/yq4DSiz
2NZfzSONCy1Zvci7kE7V
=fLX3
-----END PGP SIGNATURE-----