Operating System - HP-UX
1755470 Members
4079 Online
108833 Solutions
New Discussion юеВ

JVM issue: Could not reserve enough space for object heap

 
fkfk
New Member

JVM issue: Could not reserve enough space for object heap

My issue was that I was unable to run a java application which set a java heap size of more than approx 1024M using java (-Xmx1024M) on HP-UX 11.23 (11i v2) Itanium server. it would fail with the error "Could not reserve enough space for object heap.
But this command can work well:
java -Xmx1024M -version

java version "1.4.2.13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.13-070317-13:26)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.13-070317-18:29-IA64N IA64, mixed mode)

Actually, java -Xmx3600M -version can work well, too
We also tried this one, but failed:
-Xms128M -Xmx1024M -XX:PermSize=128m -XX:MaxPermSize=1024m

The kernel parameter maxdsiz is 4G


Following is the memory report:


GlancePlus C.04.50.00 09:58:19 insist ia64 Current Avg High
-----------------------------------------------------------------------------------------------------------------------------------------
CPU Util | 1% 1% 1%
Disk Util F | 1% 3% 8%
Mem Util S SU UB B | 85% 85% 85%
Swap Util U UR R | 34% 34% 34%
-----------------------------------------------------------------------------------------------------------------------------------------
MEMORY REPORT Users= 9
Event Current Cumulative Current Rate Cum Rate High Rate
--------------------------------------------------------------------------------
Page Faults 253 936 48.6 46.3 57.1
Page In 103 340 19.8 16.8 22.8
Page Out 0 0 0.0 0.0 0.0
KB Paged In 0kb 0kb 0.0 0.0 0.0
KB Paged Out 0kb 0kb 0.0 0.0 0.0
Reactivations 0 0 0.0 0.0 0.0
Deactivations 0 0 0.0 0.0 0.0
KB Deactivated 0kb 0kb 0.0 0.0 0.0
VM Reads 0 0 0.0 0.0 0.0
VM Writes 0 1 0.0 0.0 0.1

Total VM : 4.5gb Sys Mem : 2.5gb User Mem: 3.0gb Phys Mem: 16.0gb
Active VM: 4.4gb Buf Cache: 8.1gb Free Mem: 2.4gb


Any help would be greatly appreciated!!


Best regards

Gewei
3 REPLIES 3
SANTOSH S. MHASKAR
Trusted Contributor

Re: JVM issue: Could not reserve enough space for object heap

Hi,

Just check following kernel parameters

dbc_max_pct
dbc_min_pct

since the physical memory is 16GB on ur system
and buffer cache is 8.1GB.

Change these values to small number say 5 or 10.


-Santosh
Steven E. Protter
Exalted Contributor

Re: JVM issue: Could not reserve enough space for object heap

Shalom,

Admittedly reducing the buffer cache (previous post) will free up some memory for java.

The buffer cache is consuming approximately 50% of physical memory. Under certain circumstances this provides a performance boost.

Its bad to have it at 50% (dbc_max_pct) with Oracle databases because Oracle is better at caching its database than the OS.

Any time the system decides to change its buffer cache its incredibly hard on system resources. Having dbc_max_pct and dbc_min_pct very close to each other is a good systems administration practice.

I think the issue here is however the java application itself. It may be poorly written and seems to be consuming enormous amounts of memory. Looking at application memory use will probably be longer and harder, but this would appear to be the source of the problem.

Also check system patch level for bi-annual patches and shared memory (shmmax,shmseg).

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: JVM issue: Could not reserve enough space for object heap

The problem is that the default heap (data) value for 32bit processes has not been changed. All 32bit programs are limited to about 900 megs maximum unless they have been compiled for EXEC_MAGIC, or the program is a 64bit program. HP's version of Java is supplied in several versions (3 32bit versions and a 64bit version). But the 32bit versions cannot exceed the kernel's limits for maxdsiz.

So change maxdsiz to 1800 megs for now, and make sure you also change maxdsiz_64 to a much larger size, perhaps maxdsiz_64=5Gb. 11.23 allows for th maxdsiz and maxdsiz_64 to be changed immediately. The command line for Java can specify std 32bit, q3 and q4 for 32bit (allowing up to about 3700 Megs) or 64bit for Java (limited to about 8000 Gb or maxdsiz_64, whichever is less).


Bill Hassell, sysadmin