i have the following server:
Nothing special here, running a Java application:
-Xmx2500M
-XX:+UseConcMarkSweepGC
However, this should not use up all memory and causes the java application to not answer to nagios via JMX.
Why is this using up all my memory and creating SWAP?
Your -Xmx2500M is the maximum heap size available inside your java application. The overhead of running the JVM and managing the objects in that heap is usually 50% more but can be double the heap size. Linux top command will show this in the virtual memory usage.
A good discussion of non-heap memory usage can be found in the presentation linked here. There is another SO thread on this topic here
One quick check you can do with OpenJDK on ubuntu is to run jps to see which process ID it is, then jconsole, select the memory tab, then select the non-heap memory usage.
If you are attempting to run without swap my guess is you will need to experiment with different heap sizes to see what scenario your application can run. .