aspose file tools*
The moose likes Java in General and the fly likes JVM suddenly consumes large memory and crashes server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JVM suddenly consumes large memory and crashes server" Watch "JVM suddenly consumes large memory and crashes server" New topic
Author

JVM suddenly consumes large memory and crashes server

Kotto Bass
Greenhorn

Joined: Jan 27, 2006
Posts: 17
Hi,

I'm experiencing an anormally with JRun application server running on SUN JVM. Averagely about once a week, the server crashes without any warnings. On monitoring the memory usage, I noted that there was an unexpected jump in JVM total memory eventhough applications were not requesting extra memory. Attached is a sample screenshot with a browser-based monitoring tool from Adobe. It's showing that at about 11:58am, there was a sudden spike in JVM memory from about 384MB up to about 1022.44MB which crashed the server. The only thing I could find in the logs was a message stating: 'Permgen Space' error. There were no warnings/errors before the crash. The virtual memory used by JRun when it crashed was about 1.3GB. Any thoughts?

My environment is: JRun4 on JVM1.6.0_04 with max heap size (-Xmx) set to 1024m.



[Thumbnail for memory usage.JPG]

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

You're running out of space in the "permanent generation", where the contents of class files (classes, String literals, other fun stuff) is held. You can try bumping up the space for that memory area using

-java XX:MaxPermSize=NNNm


[Jess in Action][AskingGoodQuestions]
Kotto Bass
Greenhorn

Joined: Jan 27, 2006
Posts: 17
Ernest Friedman-Hill wrote:You're running out of space in the "permanent generation", where the contents of class files (classes, String literals, other fun stuff) is held. You can try bumping up the space for that memory area using

-java XX:MaxPermSize=NNNm


That looks good, but if you look at the attachment on the original post, the JVM total memory hits the max heap space allocated and (not shown on the graph) starts eating OS virtual memory. The 'used' memory remains low however. As an aside, our MaxPermSize is set to 250MB and max heap size set to 1024MB.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

That could just be evidence that the JVM tried everything it could do to free up space, including a full GC sweep and then calling sbrk() to grow the address space, before finally giving up. I'm not sure it's smart enough to know whether these measures are going to work or not in advance -- it might be obvious to us that it was a hopeless gesture, but it might not be obvious to it.
Kotto Bass
Greenhorn

Joined: Jan 27, 2006
Posts: 17
We increased the MaxPermSize from 256 to 512 and that resolved the issue. Thanks Ernest!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JVM suddenly consumes large memory and crashes server
 
Similar Threads
JRUN JVM Configuration
JRun is crashing on every 2nd or 3rd hit
Struts in Jrun4
JRun Servlet Engine Problem
Eclipse crashes everyday