LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Tomcat memory usage on Linux (https://www.linuxquestions.org/questions/linux-server-73/tomcat-memory-usage-on-linux-557716/)

veenaonnet 05-30-2007 07:06 AM

Tomcat memory usage on Linux
 
Hello,

I am running data intensive application on CentOS with tomcat 5.5, jdk1.5 and My Sql. I found that after running some JSPs , if I keep the system idle for some time memory usage readings are not coming down. To check if it a code problem, I created application with simple login functionality(Simple JSP and servlet) and tried to note memory usage on CentOS(rss readings) and Windows.

I found that, in Linux usage goes up upto certain limit, but after this if I keep system idle still this memory reading is not coming down. While in windows it comes down after some time.

Is there any setting for garbage collection? Exactly what should I do to resolve this issue? Because on production system if I load test the application it starts using swap memory and eventually tomcat hangs.

Thanks.

Regards,
Veena

gilead 05-31-2007 02:43 AM

EDIT: Sorry, I should have read the last part of your post about Tomcat hanging...

Can you post the output of free and ps (or top) so that we can see what is happening with your processes?

Also, have a look at http://gentoo-wiki.com/FAQ_Linux_Memory_Management for more info, Linux doesn't manage memory the same way that Windows does.

veenaonnet 05-31-2007 04:19 AM

Tomcat memory usage on Linux
 
Hi,

Thanks for your reply. Following are the ps readings for "Java" process when I run simple Login application. If you need, I will also post actual application reading but it shows the same increase pattern.

My concern is
1. why it is increasing though server is idle
2. Why it never comes down? (Is it due to caching? and if it so what should be done in production server?)

Scenario
while starting tomcat
25464
28788
29512
31960
32804
32804
32804
Tomcat Started and run application with one browser
33656
33656
33656
41496
41496
After some time, running application continuosly
41512
41512
41512
41516
41516
40964
40964
40964
40968
40968
40968
40968
40968
40968
40968
40968
Run for 2nd time
40980
40980
40980
40980
40980
Run for 3rd time
40980
40980
40980
40980
40980
40980
40980
Run for 4th time
40980
40980
40980
41008
41008
41776
41776
41776
41776
Kept idle for 10mins
41780
41780
41780
41780
41780
Run for fifth time
41784
Kept idle for 20mins
41224
and again it increases of remain constant but never decreases.

Regards,
Veena

veenaonnet 05-31-2007 04:35 AM

Tomcat memory usage on Linux
 
Hi,

Just as an information, I have 1GB memory on CentOS production server and I have set tomcat heap size to 512 MB. Is 1 GB RAM fine for data intensive application?

Regards,
Veena


All times are GMT -5. The time now is 01:12 PM.