Reputation: 31
I'm trying to figure out what's happening with my application.
Problems:
GC invoking doesn't reduce unused heap size as much as it should, but it should since I'm using serial GC (or UseParNewGC) and agressive heap ratios.
The program's memory in use is always a lot bigger than the current used and unused heap, too much in my opinion even with other JVM memory included + heap
Command line used:
java -XX:+UseSerialGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -Xmx2500M -cp XXXXXX.jar xxxx.xxxx.xxxx
pause
tried with UseParNewGC, same results
System: Win7 SP1 4GB RAM + 4GB swapfile 2.99GHZ Java 1.7 + JDK 1.7
Please see picture to make things more clear: https://i.sstatic.net/i3sxw.jpg
Upvotes: 3
Views: 437
Reputation: 8432
Rather than set free ratios, try to set the New Generation
to a size that enables the short-lived objects to die. Trying to promote as few as possible to the Old Generation
.
Bear in mind that larges Young Generation
turns into large collections.
Then set the max Old Generation
to a size that does not take too long to full GC
but does not constantly runs them.
Upvotes: 1