Tarasso wrote:
If I where to buy a Plan and wanted to tun java , I would need at least 128MB of ram to keep from running out of memory right?
Sort of,
We've been running Tomcat on a Linode for a while now, and even though we have a 128Mb linode system, and have restricted Tomcat to only use only 40Mb of memory with the following line in /etc/profile
export CATALINA_OPTS="-Xint -Xrs -Xmx40m -Xverify:none -XX:+UseParallelGC"
The Tomcat process grows to consume more than 100Mb of memory (see RSS in a snapshot of TOP below).
===============================================
04:31:31 up 119 days, 8:21, 1 user, load average: 0.55, 0.15, 0.04
86 processes: 83 sleeping, 3 running, 0 zombie, 0 stopped
CPU states: 62.3% user, 4.7% system, 0.0% nice, 33.0% idle
Mem: 123640K total, 121304K used, 2336K free, 2140K buffers
Swap: 263160K total, 12260K used, 250900K free, 53344K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
13440 root 9 0 103M 100M 54140 S 0.0 83.3 0:09 java
13442 root 9 0 103M 100M 54140 S 0.0 83.3 0:00 java
13443 root 9 0 103M 100M 54140 S 3.9 83.3 0:01 java
13444 root 9 0 103M 100M 54140 S 3.7 83.3 0:01 java
===============================================
Why is this so? It's due to the fact that -Xmx only restricts the "heap" size used by your java program, not the memory that the JVM will use as well (such as stack / hotspot compiling and anything else it needs).
If you are running short duration processes, that don't need a lot of memory, you should be fine. We run a webserver, 24/7, that is lightly loaded, and are running fine. But due to the problem above (the JVM using a large chunk of our available 128Mb of memory) we dangerously drift into using swap space. This is one of the main reasons we are looking to upgrade by another 64 / 128Mb this year - to help minimize swap space usage.