Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to reduce Sun/Oracle JVM internal overhead?
    primarykey
    data
    text
    <p>This problem is specifically about <strong>Sun Java JVM running on Linux x86-64</strong>. I'm trying to figure out <strong>why the Sun JVM takes so much of system's physical memory even when I have set Heap and Non-Heap limits</strong>.</p> <p>The program I'm running is Eclipse 3.7 with multiple plugins/features. The most used features are PDT, EGit and Mylyn. I'm starting the Eclipse with the following command line switches:</p> <pre><code>-nosplash -vmargs -Xincgc -Xms64m -Xmx200m -XX:NewSize=8m -XX:PermSize=80m -XX:MaxPermSize=150m -XX:MaxPermHeapExpansion=10m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseParNewGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=5 -XX:GCTimeRatio=49 -XX:MaxGCPauseMillis=50 -XX:GCPauseIntervalMillis=1000 -XX:+UseCMSCompactAtFullCollection -XX:+CMSClassUnloadingEnabled -XX:+DoEscapeAnalysis -XX:+UseCompressedOops -XX:+AggressiveOpts -Dorg.eclipse.swt.internal.gtk.disablePrinting </code></pre> <p>Worth noting are especially the switches: </p> <pre><code>-Xms64m -Xmx200m -XX:NewSize=8m -XX:PermSize=80m -XX:MaxPermSize=150m </code></pre> <p>These switches <strong>should limit the JVM Heap to maximum of 200 MB and Non-Heap to 150 MB</strong> ("CMS Permanent generation" and "Code Cache" as labeled by JConsole). Logically the JVM should take total of 350 MB plus the internal overhead required by the JVM.</p> <p><strong>In reality, the JVM takes 544.6 MB</strong> for my current Eclipse process as computed by ps_mem.py (<a href="http://www.pixelbeat.org/scripts/ps_mem.py" rel="nofollow noreferrer">http://www.pixelbeat.org/scripts/ps_mem.py</a>) which computes the real physical memory pages reserved by the Linux 2.6+ kernel. <strong>That's internal Sun JVM overhead of 35% or roughly 200MB!</strong></p> <p><strong>Any hints about how to decrease this overhead?</strong></p> <p>Here's some additional info:</p> <pre><code>$ ps auxw USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND me 23440 2.4 14.4 1394144 558440 ? Sl Oct12 210:41 /usr/bin/java ... </code></pre> <p>And according to JConsole, the process has used 160 MB of heap and 151 MB of non-heap.</p> <p>I'm not saying that I cannot afford using extra 200MB for running Eclipse, but if there's a way to reduce this waste, I'd rather use that 200MB for kernel block device buffers or file cache. In addition, I have similar experience with other Java programs -- perhaps I could reduce the overhead for all of them with similar tweaks.</p> <p>Update: After posting the question, I found previous post to SO: <a href="https://stackoverflow.com/questions/1612939/why-does-the-sun-jvm-continue-to-consume-ever-more-rss-memory-even-when-the-heap">Why does the Sun JVM continue to consume ever more RSS memory even when the heap, etc sizes are stable?</a> It seems that I should use <code>pmap</code> to investigate the problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload