Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: running a Java VM
PostPosted: Wed Dec 22, 2004 3:29 pm 
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?


Top
   
 Post subject:
PostPosted: Fri Dec 31, 2004 6:05 am 
Offline
Junior Member
User avatar

Joined: Thu Jul 08, 2004 3:24 pm
Posts: 26
Location: London, UK
That would depend entirely on what you used as the argument to -Xmx, and what other options you used to pare back on memory use.


Top
   
 Post subject: Re: running a Java VM
PostPosted: Mon Jan 03, 2005 12:35 am 
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.


Top
   
 Post subject: Re: running a Java VM
PostPosted: Tue Jan 04, 2005 6:02 am 
Offline
Junior Member

Joined: Wed Jul 21, 2004 4:45 am
Posts: 21
Website: http://www.percederberg.net
Location: Stockholm, Sweden
amcghe wrote:
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).

I've found that the JVM "respects" the -Xmx switch much better when using the -client VM (instead of the -server VM). This is of course due to the fact that it doesn't store as much precompiled code in memory.

I'm also on 128MB and it works pretty well, except for some issues with the mod_jk2 connector or (what it seems like) Tomcat itself suddenly doubling or tripling the memory usage in very short time. Those are probably bugs, but I've yet failed to isolate them.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group