• 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
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Tomcat 5.0.28 OutOfMemoryError

 
Ranch Hand
Posts: 53
Android C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm running a Tomcat service and kept on getting outofmemoryerror.

I have tried increasing the heap size using 2 different methods and both failed:

1) "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Xmx1024m;-Xms128m"
2) "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMx 1024m --JvmMs 128m"

Still getting the same outofmemoryerror.

This is on a server and we have sufficient memory.
Please advice.



 
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
Wow, you sure left out a LOT of important details!

1. How many requests are serviced before the system runs out of memory? One, dozens, hundreds, thousands?
2. What resources does the service use? ie: databases, external program calls? graphics contexts?


If this was my problem I would be using the tomcat Management application to monitor memory and Thread use change with time. The cause might just jump out at you from those statistics.

Bill
 
Ranch Hand
Posts: 75
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kim Ming Yap wrote:I'm running a Tomcat service and kept on getting outofmemoryerror.

I have tried increasing the heap size using 2 different methods and both failed:

1) "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Xmx1024m;-Xms128m"
2) "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMx 1024m --JvmMs 128m"

Still getting the same outofmemoryerror.

This is on a server and we have sufficient memory.
Please advice.



try to set CATALINA_OPTS as follow:
set CATALINA_OPTS=-server -Xms128m -Xmx1024m

or follow instructions posted here:
JVM Max Memory
http://www.yellowfinbi.com/YFForum.i4?thread=90378&post=0
even if you're not running Yellowfin, it's still nice step-by-step doc

1G ram sounds to be a fair value, but still... I saw applications throwing exceptions with -Xmx4G
(btw, if you will consider to test -Xmx with more than 2G, make sure your OS is 64 bit).

hope it helps. Good luck!
http://www.uki6.com
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without knowing the exact OutOfMemoryError message, we can only guess..

My guess is that you need to add the -XX:PermSize=256m and -XX:MaxPermSize=256m to your java options.

By default, MaxPermSize will be 32mb for -client and 64mb for -server.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic