Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Tom Sanders
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21112
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic