Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes Tomcat 5.0.28 OutOfMemoryError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 5.0.28 OutOfMemoryError" Watch "Tomcat 5.0.28 OutOfMemoryError" New topic
Author

Tomcat 5.0.28 OutOfMemoryError

Kim Ming Yap
Ranch Hand

Joined: Dec 17, 2008
Posts: 53

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

Joined: Mar 22, 2000
Posts: 12761
    
    5
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

Joined: Apr 29, 2011
Posts: 75

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

Joined: Oct 12, 2001
Posts: 1179

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.


Regards, Rene Larsen
Dropbox Invite
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 5.0.28 OutOfMemoryError
 
Similar Threads
Installing Tomcat
Issues with multiple Tomcat 7 services on Windows
heap size in apache tomcat 5.x
Heap Memory usage
Error with tomcat as win2k service