5
votes

jmap -heap gives me output that says:

New Generation Used 100%, Eden Space Used 100%, From Space Used 100%, To Space Used: 0%, Perm Generation Used: 38%

Is this 100% of New, Eden, From space - a problem?

My JAVA OPTS are: -Xms10240m -Xmx14336m -XX:PermSize=192m -XX:MaxPermSize=256m -XX:NewSize=8192m -XX:MaxNewSize=8192m -XX:-DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=60

I see a lot of quick Garbage Collection. But no memory leaks using tools like JConsole

The Memory Usage can be seen here: http://tinypic.com/view.php?pic=wo213&s=6

JDK 1.6 is in use.

3
Are you experiencing problems in your software?heikkim
Application is being reported occasionally as slow. Overall memory usage is fine though, well below max memory. But New Gen, Eden etc. if often close to 100%. Could that be the issue?Jasper
New Gen and Eden being full may trigger a lot of fast GCs. Check that out with jstat, and if there are too many GCs you may want to increase Eden and/or NewGen space. It will be a trial and error process, though, to find your optimal configuration.Soronthar

3 Answers

6
votes

Well that is how generational collection works. You have young space (eden, from, to) and old space (tenure, perm). Young space is smaller. Once young space is full (your case) - thing called minor GC (young GC) is happening.

But minor GC should be quick. Once old space is full full GC is happening (which is more time consuming).

Idea is to have more frequent fast minor GCs and much less frequent full GCs.

You can read much more detailed explanation in this article

3
votes

I have found the following two commands very useful

jstat -gc

or

jstat -gcutil
-1
votes

Might be prudent to also check for memory leaks. Use visualVM or some other tool (e.g. Eckipse memory analyzer) and attach it to the process.

Once you know what is leaking, you can find what is holding references to the objects, such as

jmap -dump:live,file=heap.dump.out,format=b <pid>

jhat heap.dump.out

Also, just wondering, what JVM version is this, the parameters you've passed for GC etc.