aspose file tools*
The moose likes Java in General and the fly likes Max heap of 2GB specified but but OutOfMemory-Exception with heap only having 1.1GB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Max heap of 2GB specified but but OutOfMemory-Exception with heap only having 1.1GB?" Watch "Max heap of 2GB specified but but OutOfMemory-Exception with heap only having 1.1GB?" New topic
Author

Max heap of 2GB specified but but OutOfMemory-Exception with heap only having 1.1GB?

Tom Sanders
Greenhorn

Joined: May 09, 2011
Posts: 5
Hi there,

I have an application with should use at most 2GB of heap, as specified via -Xmx2048m, however it regularly throws an OutOfMemory-Exception (even after I increased the max heap amount to 3GB). After I examined the the heap, I noticed that it is only 1.1GB in size which leaves me abit puzzled as to why this is happening.
I mean, if it cannot allocate more than 1.1GB, then the app should even start with the -Xmx2048m param but instead throw an OoM-Exception immediatly.

Does anyone know what can cause this? As a sidenote, the jvm-vendor is IBM, version is 1.6 and operating system is AIX.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18836
    
  40

Tom Sanders wrote:Hi there,

I have an application with should use at most 2GB of heap, as specified via -Xmx2048m, however it regularly throws an OutOfMemory-Exception (even after I increased the max heap amount to 3GB). After I examined the the heap, I noticed that it is only 1.1GB in size which leaves me abit puzzled as to why this is happening.
I mean, if it cannot allocate more than 1.1GB, then the app should even start with the -Xmx2048m param but instead throw an OoM-Exception immediatly.

Does anyone know what can cause this? As a sidenote, the jvm-vendor is IBM, version is 1.6 and operating system is AIX.



A shot in the dark .... Try adding -Xms2048m to the command line to see if that gets the desired result.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Max heap of 2GB specified but but OutOfMemory-Exception with heap only having 1.1GB?