Howdy, So the same tomcat version and same JDK version on different platforms yield different results? ;) That's a shocker... There have been discussions on this list in the past regarding the unreliability (is that a noun??) of the top command on linux. You can search the archives for more details.
You can use Runtime#totalMemory and the likes to measure heap memory usage in a platform-independent way. Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 24, 2003 2:53 PM >To: [EMAIL PROTECTED] >Subject: Tomcat heap memory allocation in Linux > >Hi, > >I am using tomcat 4.1.27 running on Red Hat Linux 9 and Sun's JDK 1.4.1_01. >Here is my issue. I wanted to allocate more heap space to run tomcat. So, >I >placed the following line in the file catalina.sh: > > JAVA_OPTS="-Xms256m -Xmx400m" > >I shut down tomcat, reboot linux, and started tomcat. I executed the >command >top to verify the memory is actually being used up by tomcat. Here is the >result of the top command: > >CPU states: 0.5% user, 8.7% system, 0.0% nice, 90.7% idle >Mem: 384716K av, 183864K used, 200852K free, 0K shrd, 18980K >buff >Swap: 257000K av, 28672K used, 228328K free 59340K >cached > >If you noticed, memory usage is less than the 256MB that I specified. If >you >consider that other processes are also running, tomcat is not consuming the >initial 256MB that I specified in the JAVA_OPTS. I thought maybe the start >command for tomcat is worry. So, I ran a ps on the tomcat process and got >the >following: > >UID PID PPID C STIME TTY TIME CMD >root 6982 1 0 15:11 pts/1 00:00:11 /var/app/java/bin/java - >Xms256m -Xmx400m -Djava.endorsed.dirs=/var/app/tomcat/bin:/v > >I think this showed the executed command to start tomcat is correct. I am >not >sure what is going on. Is the top command not returning an accurate >reading? >Am I forgot to do something here? By the way, I also tried CATALINA_OPTS >instead of JAVA_OPTS and got the same result. > >Here is the strange thing. When I used the JAVA_OPTS with tomcat 4.1.27 >running on Windows2000 server and Sun's JDK 1.4.1_01, tomcat is actually >consuming the initial memory that I specified in JAVA_OPTS. > >Does anybody have an idea? Any help would be appreciated. > >Thanks, > >Son > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]