Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 5.0.28 OutOfMemoryError

 
Kim Ming Yap
Ranch Hand
Posts: 53
Android C++ Java
  • 0
  • Mark post as helpful
  • send pies
  • 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.



 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic