Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2007

Tip: Looking for answers? Try searching our database.

Tomcat keeps crashing on low activity site, any suggestions?

Thread view: 
Berlin  Brown - 12 Oct 2007 22:08 GMT
I have a Tomcat based site, that receives about 4000 requests a day.
It is a low memory server with only 350MB of ram.  But I would think
that that even Tomcat should be able to handle that.  Anyway, I keep
getting out of memory errors and the JVM will normally quit after it
reaches a certain threshold.  I want to post this and see if it rings
a bell with anyone.  I am currently using LambdaProbe(tomcat probe) to
collect memory utilization, memory statistics.

Application itself.
Spring2, Hibernate3, MySQL5 based application.
Java(TM) 2 Runtime Environment, Standard Edition  1.5.0_08-b03  Java
HotSpot(TM) Server VM)
Linux (unknown) i386 2.6.9-023stab043.1-enterprise
Apache Tomcat/5.5.20

Here are some memory stats from Lambda Probe.  These are stats while
the application is running.  I am assuming relative to the heap? as
opposed to the system memory.

Current memory usage is     42.8%
Free: 89.51 MB Total: 197.94 MB Max: 253.19 MB

Name Usage score Plot Used Committed Maximum Initial Group
 Survivor Space       1.09Mb  2.19Mb  2.81Mb  2.19Mb  HEAP
 Perm Gen       45.98Mb  46.00Mb  64.00Mb  16.00Mb  NON_HEAP
 Tenured Gen       106.23Mb  177.81Mb  227.56Mb  177.81Mb  HEAP
 Eden Space       12.61Mb  17.94Mb  22.81Mb  17.81Mb  HEAP
 Code Cache       10.17Mb  10.19Mb  48.00Mb  2.25Mb  NON_HEAP
 Total       176.09Mb  254.13Mb  365.19Mb  216.06Mb  TOTAL

I am also assuming that when the "Free" memory reaches 0, that the JVM
will crash.  I can't tell because the probe application is running
inside of that jvm.

Here is an error from the logs when the jvm stops.

Key line = "JVM exited unexpectedly while stopping the application."

INFO   | jvm 1    | 2007/10/12 14:23:22 | 2007-10-12 14:23:22,183 INFO
[org.spirit.spring.BotListRubyController] - <BotListRubyController:
showForm() uri=/botlist/spring/botverse/linkaddcomment.html>
INFO   | jvm 1    | 2007/10/12 14:23:22 | 2007-10-12 14:23:22,183 INFO
[org.spirit.spring.BotListRubyController] - <BotListRubyController:
getDefaultViewNameFromRequest() - From Request:
http://www.botspiritcompany.com/botlist/spring/botverse/linkaddcomment.html>
ERROR  | wrapper  | 2007/10/12 14:23:26 | JVM exited unexpectedly
while stopping the application.
STATUS | wrapper  | 2007/10/12 14:23:26 | <-- Wrapper Stopped

STATUS | wrapper  | 2007/10/12 15:05:03 | --> Wrapper Started as
Daemon
STATUS | wrapper  | 2007/10/12 15:05:03 | Launching a JVM...

Berlin Brown
Manish Pandit - 12 Oct 2007 23:36 GMT
> I have a Tomcat based site, that receives about 4000 requests a day.
> It is a low memory server with only 350MB of ram.  But I would think
[quoted text clipped - 49 lines]
>
> Berlin Brown

You may consider running MySQL on some other box to save memory for
Tomcat. Also, run 'top' to see which processes are taking significant
amount of memory. You can tune the server to not start the demon
processes that are not needed (like nfsd, mountd, etc.).

-cheers,
Manish
Berlin  Brown - 13 Oct 2007 02:15 GMT
> > I have a Tomcat based site, that receives about 4000 requests a day.
> > It is a low memory server with only 350MB of ram.  But I would think
[quoted text clipped - 57 lines]
> -cheers,
> Manish

I don't think it is the server but Tomcat.  This application is really
the only one running and mysql hasn't had any problems.
Mark Clements - 13 Oct 2007 17:21 GMT
Berlin Brown wrote:
> I have a Tomcat based site, that receives about 4000 requests a day.
> It is a low memory server with only 350MB of ram.  But I would think
[quoted text clipped - 3 lines]
> a bell with anyone.  I am currently using LambdaProbe(tomcat probe) to
> collect memory utilization, memory statistics.

Are you hitting the default heap size limit?

http://www.chemaxon.com/jchem/doc/admin/tomcat.html

Mark
Roedy Green - 14 Oct 2007 13:03 GMT
On Fri, 12 Oct 2007 14:08:40 -0700, Berlin  Brown
<berlin.brown@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>I am also assuming that when the "Free" memory reaches 0, that the JVM
>will crash.  I can't tell because the probe application is running
>inside of that jvm.

IF GC can't free enough RAM, it has no choice but to crash.

I see two possibilities:

1. you are packratting.  see
http://mindprod.com/jgloss/packratting.html

2. your app needs at minimum more RAM that you have.  Try increasing
the size of the virtual RAM paging file or get more real RAM.  It is
much cheaper than it used to be.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.