aspose file tools*
The moose likes Java in General and the fly likes OutOfMemoryErrors and the native heap 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 "OutOfMemoryErrors and the native heap" Watch "OutOfMemoryErrors and the native heap" New topic
Author

OutOfMemoryErrors and the native heap

Mike Noel
Ranch Hand

Joined: Dec 15, 2005
Posts: 108
I've got an application that was started with mx512m. My understanding is that this limits the JVM heap to 512MB of space. While watching the actual java process (using top) I am seeing the memory usage for the process go up to over 1GB of memory. Once the memory gets this high I start seeing java.lang.OutOfMemory errors.

One of the packages I'm using seems to be using the File.deleteOnExit() method. A bug on Sun's site indicates that this method causes native heap memory leaks. I can understand that that would cause my process memory to go up but would it cause OutOfMemoryErrors?.

I thought that the OutOfMemoryError meant that I didn't have anymore JVM heap space left (limited to 512mb in my case). Is it possible that I'm seeing the OutOfMemoryError due to the size of the native heap?

Thanks.

_M_


Mike Noel
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

Have you monitored garbage collection to see how frequent it is being performed? OutOfMemoryErrors can be caused any time garbage collection (assuming it ran) fails to re-allocate enough memory to continue.

I'd run your application through a 3rd party profiling tool and monitor memory allocation and use. The memory leak could be coming from anywhere.


My Blog: Down Home Country Coding with Scott Selikoff
Mike Noel
Ranch Hand

Joined: Dec 15, 2005
Posts: 108
It looks like that's what I'm going to have to do. My problems seem to revolve around the apache commons FileUpload package so I may have to dig into that code too.

_M_
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutOfMemoryErrors and the native heap
 
Similar Threads
OutOfMemoryError below max heap
Eclipse 3 memory consumption
java.io.IOException : can't allocate memory
Out of memory error:java heap space ?
JVM Memory