Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using a play framework webapplication calling webservices, all these applications are deployed in one tomcat/apache server, when in production box, multiple process are started for tomcat which are occupying same MEM% which can be verified by top command. When the server is just started there are around 15 process which occupy 22% MEM (800m RES) and when the application is hit then the number of process increase to around 30-35 process.

As you can see the RES (Resident memory usage) is 880MB to 1.2 Gig, While the maximum memory allotted to tomcat is 256 MB using, -XX:PermSize=256m -XX:MaxPermSize=256m

Totally there are 3 web-application wars and 3 service wars deployed in this tomcat instance

PLEASE EXPLAIN HOW CAN I REDUCE THE MEMORY USAGE AND PROCESS FOR THIS APPLICATION???

AFTER START OF SERVER

top - 01:33:42 up 59 days, 1 min, 11 users, load average: 4.76, 4.49, 3.29 Tasks: 1496 total, 1 running, 1493 sleeping, 0 stopped, 2 zombie Cpu(s): 31.3%us, 1.9%sy, 0.0%ni, 64.8%id, 1.0%wa, 0.2%hi, 0.8%si, 0.0%st Mem: 3759600k total, 3707492k used, 52108k free, 57912k buffers Swap: 6313480k total, 3353744k used, 2959736k free, 155216k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23070 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23071 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23072 resoluti 20 0 1330m 931m 9316 S 0 25.4 3:29.07 java
23073 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:06.84 java
23074 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:06.98 java
23075 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:28.86 java
23076 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.04 java
23077 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.16 java
23078 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23079 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:55.73 java
23080 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:52.07 java
23081 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23082 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.12 java
23083 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23085 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23647 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23883 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23885 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23887 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
23893 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24114 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24122 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24123 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24126 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24354 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24375 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24778 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
24843 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25059 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25069 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.04 java
25070 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25071 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:02.62 java
25072 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.86 java
25073 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.40 java
25076 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25077 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25078 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25079 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25080 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25559 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25560 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25561 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
25562 resoluti 20 0 1330m 931m 9316 S 0 25.4 0:00.00 java
17792 resoluti 20 0 86728 6376 1716 S 1 0.2 2:06.83 python
17793 resoluti 20 0 86728 6376 1716 S 0 0.2 0:00.04 python

17794 resoluti 20 0 86728 6376 1716 S 0 0.2 0:07.62 python
25340 resoluti 20 0 2868 1840 768 R 1 0.0 0:01.02 top
17791 resoluti 20 0 13724 1428 1428 S 0 0.0 0:00.14 python

share|improve this question
    
Could you post the complete command line call of any of those java process? (# ps auxwww | grep java) –  Mario Feb 9 '12 at 8:37
    
"jps -mv" makes it a lot easier to get that info, btw. –  pyroscope Feb 10 '12 at 21:51

1 Answer 1

Not really a Tomcat issue, but a (Oracle) JVM one. MaxPermSize sets the size of the permanent generation used for class loading, and then there's the heap which is normally larger. And this (plus native memory) is what uses the remaining memory.

See for example this blog post

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.