Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Tomcat Memory issue

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

We are using tomcat 6.0.16 and we are facing memory issues with it. There is only one webapp and axis2 webservice deployed on the server. The server is having 6GB RAM and we are allocating heap space of 3GB to tomcat server but still its getting memory issues.

I am providing following java options in catalina.sh



I checked with the jconsole profiler and found that the memory increases to 3GB and then suddenly drops to 1.3-1.5GB and then again increases. The CPU usage, number of threads and classes are nearly constant.

We are suspecting that memory is not getting released continuously and thats why when it reaches to Max, its forcefully calling GC and releasing all the memory(nearly 1.5 GB)

Please look into the attached profiler screenshot for more details. Can anybody help me to resolve this issue?

Regards,
Pankaj
profiler.png
[Thumbnail for profiler.png]
 
PankajKumar jaiswal
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that using profiler adds the extra overhead and the java options for that is added just temporarily to check the performance and find out the issue.

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, exactly what is the issue? Is it crashing? Causing long delays during GC?

Isn't this exactly the behavior you would expect with Java managed GC?

Bill
 
PankajKumar jaiswal
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am facing this exception when the server memory usage increases...

EVERE: Socket accept failed
java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:453)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
at java.lang.Thread.run(Thread.java:619)
Oct 15, 2009 8:20:32 AM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
SEVERE: Socket accept failed

Anybody else faced this issue?
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I had the problem:

java.net.SocketException: Too many open files


I would be looking for files or sockets not being closed when you are through with them.

I suspect your problem has nothing to do with memory and everything to do with cleaning up after requests.

Bill
 
PankajKumar jaiswal
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue is resolved when we increased the ulimit of the server from 1024 to 4096.

Thanks all to pointing me in the right direction.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic