Memory Usage on Tomcat

I am running application on Linux CentOS machine with Tomcat 5 jdk1.4.2 and My Sql 5.0.22. System has 1 GB of physical RAM. This is data intensive application.

When I load test this application with 16 browsers hitting functionalities continuously for 2 hrs, memory usage becomes very high and it starts using swap memory. After some time when swap memory is also not available tomcat shuts down automatically.

My questions are -

1. Is it a problem with code/tomcat that memory usgae is not decreasing/ objects are not garbage collected.

2. Should I change the server to JBoss?

3. Do I need to increase the physical RAM? How much?

4. Is there any tool to find out problems with code?

Thanks.

Veena

[753 byte] By [veenaonneta] at [2007-11-27 3:18:36]
# 1

I had recently to deal with these problems too so I hope you may profit from my experiences. (I am not a java expert or java guru;-)

To your first question:

Yes, i suppose objects are not garbage collected. This ist the first thing you should prove. Do you store your objects in a session and how many? I recommend you to use visualgc tool. It helps you understand how the memory is being used.

Here two very good start points:

http://java.sun.com/docs/hotspot/gc1.4.2/index.html

http://java.sun.com/performance/jvmstat/

2.

I don't think it would solve your problem.

3.

Before you do this step check first if your GC does its job properly. (To your first question)

4.

I'm useing Borland's Optimizeit profiler (shareware). There is also tctc module from Eclipse.

I hope it can help you further...

e-boa at 2007-7-12 8:21:15 > top of Java-index,Java HotSpot Virtual Machine,Specifications...