tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Harper" <rob...@iat-cti.com>
Subject RE: tomcat memory usage questions
Date Tue, 03 Oct 2006 14:00:04 GMT
The memory should peak at some point and the go up and down with need. There
are a few things you have to be aware of though. The garbage collector is a
very low priority thread so if your server never has a dull moment, you end
up exhausting memory just because the garbage collector does not get a
chance to run.

Care in development should be taken with respect to use of objects and
having circular references. You can cause memory leaks with circular
references because you might leave free and object from the servlet but then
have two objects referring to each other and the GC will not see them as
having gone out of scope. Another thing to think about is if you are doing a
lot of string concatenation the StringBuffer object is much better to use
than the String object. StringBuffer will be easier on memory and more
efficient.



Robert S. Harper
Information Access Technology, Inc.

-----Original Message-----
From: Rizwan Merchant [mailto:rizwan.merchant@sysconet.ca] 
Sent: Tuesday, October 03, 2006 7:41 AM
To: tomcat
Subject: tomcat memory usage questions

Hi,
We recently developed and deployed a web based application using the 
following technologies...

Struts
Spring
Hibernate 3.0
Mysql 5.0
tomcat 5.5
Linux Fedora Core 4

After the system went live, I have been monitoring the CPU and memory 
usages. I dread the outOfMemory errors and am a little paranoid about it.

There are 2 main processes I am monitoring, tomcat and mysqld.
The tomcat process memory usage is slowly creeping up...after 8 hours of 
application usage it is at 13.3% and the mysqld memory usage is at 1.3%.

I am wondering what kind of pattern I should be observing for the memory 
usages. Should it go up and then down again (like the CPU usage)? Or is 
it ok for it to slowly go up (the way it is doing right now)? The swap 
memory is not being used, so I am guessing thats a good thing.

Also, someone told me that hibernate and spring will try and cache 
everything it can, which could be the cause of the memory creeping up 
slowly. Is this true? and if it is, will this be a problem when the 
memory gets to a high number like 80 or 90% ?

Also, is there a way to tell if there are any processes spawned by 
tomcat that are hanging around uselessly?

Any help, ideas, tips would be appreciated. I am just concerned about 
having any memory issues with this LIVE application.

Thanks,
-Riz.

<http://forum.springframework.org/newreply.php?do=newreply&p=79473>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message