Re:How a fix in Go 1.9 sped up our Gitaly service by 30x
by paulfurtado on Thursday January 25, 2018 @10:20PM
(#16236792)
It's not bloat or memory leaks per se, the JVM just does not return memory to the OS after it is freed. To limit its memory usage, tune the heap size. To fully allocate the heap on startup for consistent usage, use -XX:+AlwaysPreTouch
[ Parent
| on HN ]
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x
by chinhodado on Thursday January 25, 2018 @11:41PM
(#16237068)
Last time I checked, I still couldn't control the max heap free ratio, because apparently that option/flag just doesn't work with Java 8's default GC.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x
by axaxs on Thursday January 25, 2018 @11:00PM
(#16236946)
Java has always been 'use memory to increase speed...sometimes'. You can tune it some, sure, but that's what it's known to do.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x
by nurettin on Friday January 26, 2018 @12:27AM
(#16237216)
Back when I tried running a jruby application on 800mb ram, it bloated, then started throwing "OutOfMemoryError"s and "Insufficient Class Space" or something similar. Apparently jruby was generating too many new types at runtime to accommodate rails framework. Garbage collector was pretty garbage at it's job back in 2011.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x
by readittwice on Friday January 26, 2018 @01:36AM
(#16237423)
AFAIR JRuby creates a Java class for each Ruby method. Classes were part of the Permanent Generation, so sometimes this generation was too small escpecially when using Rails. It was enough to just increase the size of this generation with -XX:MaxPermSize (-Xmx doesn't increase the permanent generation's size).
The Permanent Generation was named that way since objects in there were never collected. For most applications this isn't really a problem. Running JRuby+Rails just allocated a lot of classes in this generation, so the default size was too small. But still, the permanent generation was quite small compared to the heap size.
I wouldn't really call the GC bad because of this, IMHO they were already quite good back then. And in Java 8 the permanent generation was replaced with the Metaspace, objects in there can be free'd and the Metaspace can be expanded at runtime so it's less likely to get these OOM errors for the permanent generation.