Why is it that the memory use (resident memory reported by top) grows to be much larger than the heap? I have a Linux Centos 5 server running JBoss 5 with JDK1.6_29. We are using the latest collectors and a maximum heap of 12GB. I can see that the young generation is never larger than 3.5 GB, the Old Generation is never larger than 300MB, adn the Perm Gen is never alrger than 100 MB. I can see the heap being collected when it aproaches 3.8GB and the JVM has set limits of 4GB and 8GB fro the young and old gen.
My settigns are as follows:
JAVA_OPTS="-d64 -Xms12288m -Xmx12288m -XX:MaxPermSize=512m -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=19 -XX:+AggressiveOpts -Dsun.lang.ClassLoader.allowArraySyntax=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
The physical memory of the server is about is about 16GB. When I re-start JBoss, the resident memory is about 4GB and during the week, it increases steadly up to 8.4GB at which pointwe start to see that the OS starts paging into swap. Is the resident memory mainly non-heap or for soft references, or both?
Why should the server page anything when the resident memory of the JBoss process reaches about 8.5GB whn there is still another 8GB of total memory available to the OS?
The answer to all of the above comes from understanding, in detail, how virtual memory works and what impact the management (by the OS) of that has on various tools.
You might want to start by research exactly what top tells you and what it doesn't.