sudhirgoogle
asked on
Could not reserve enough space for object heap, Could not create the Java virtual machine on RHEL 5.10
I am unable to reserve java heap memory more than 1582MB on RHEL 5.10, inspite of having 6gig free memory.
[root@ora-dev15-ebs ~]# cat /etc/issue
Oracle Linux Server release 5.10
Kernel \r on an \m
[root@ora-dev15-ebs ~]#uname -a
Linux ora-dev15-ebs 2.6.32-400.34.3.el5uek #1 SMP Thu Feb 13 15:00:42 PST 2014 i686 i686 i386 GNU/Linux
[root@ora-dev15-ebs ~]# free -mtl
total used free shared buffers cached
Mem: 8066 1660 6405 0 109 533
Low: 760 284 475
High: 7305 1375 5930
-/+ buffers/cache: 1017 7049
Swap: 10239 0 10239
Total: 18306 1660 16645
[root@ora-dev15-ebs ~]# java -Xmx1582m -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) Server VM (build 20.7-b02, mixed mode)
[root@ora-dev15-ebs ~]# java -Xmx1583m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
[root@ora-dev15-ebs ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 64496
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 64496
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@ora-dev15-ebs ~]# cat /etc/issue
Oracle Linux Server release 5.10
Kernel \r on an \m
[root@ora-dev15-ebs ~]#uname -a
Linux ora-dev15-ebs 2.6.32-400.34.3.el5uek #1 SMP Thu Feb 13 15:00:42 PST 2014 i686 i686 i386 GNU/Linux
[root@ora-dev15-ebs ~]# free -mtl
total used free shared buffers cached
Mem: 8066 1660 6405 0 109 533
Low: 760 284 475
High: 7305 1375 5930
-/+ buffers/cache: 1017 7049
Swap: 10239 0 10239
Total: 18306 1660 16645
[root@ora-dev15-ebs ~]# java -Xmx1582m -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) Server VM (build 20.7-b02, mixed mode)
[root@ora-dev15-ebs ~]# java -Xmx1583m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
[root@ora-dev15-ebs ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 64496
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 64496
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
ASKER
I have similar 32bit arch server on which i can set heap size upto 2.6Gig
[root@ora-dev14-ebs ~]# cat /etc/issue
Oracle Linux Server release 5.7
Kernel \r on an \m
[root@ora-dev14-ebs ~]# uname -a
Linux ora-dev14-ebs 2.6.18-274.el5PAE #1 SMP Mon Jul 25 13:45:56 EDT 2011 i686 i686 i386 GNU/Linux
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]# free -mtl
total used free shared buffers cached
Mem: 8114 3191 4922 0 282 1630
Low: 818 532 286
High: 7295 2659 4636
-/+ buffers/cache: 1279 6835
Swap: 10239 0 10239
Total: 18354 3191 15162
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]# java -Xmx2600m -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) Server VM (build 20.7-b02, mixed mode)
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 147456
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 147456
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]# cat /etc/issue
Oracle Linux Server release 5.7
Kernel \r on an \m
[root@ora-dev14-ebs ~]# uname -a
Linux ora-dev14-ebs 2.6.18-274.el5PAE #1 SMP Mon Jul 25 13:45:56 EDT 2011 i686 i686 i386 GNU/Linux
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]# free -mtl
total used free shared buffers cached
Mem: 8114 3191 4922 0 282 1630
Low: 818 532 286
High: 7295 2659 4636
-/+ buffers/cache: 1279 6835
Swap: 10239 0 10239
Total: 18354 3191 15162
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]# java -Xmx2600m -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) Server VM (build 20.7-b02, mixed mode)
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]#
[root@ora-dev14-ebs ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 147456
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 147456
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@ora-dev14-ebs ~]#
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
is there any other alternate method to allocate contiguous virtual memory for heap? somehow i must allocate memory around 2gig. Please help.
If it is a problem with fragmentation of the virtual address space then your best bet would be a simple reboot and then attempting to launch the Java process ahead of other services on the machine.
But if you have 6GB of addressable RAM, then I think you must be running a 64-bit OS (it's not very clear to me from what you posted - I think you should run "uname -m" to clarify this). If you are on a 64-bit OS, then is there any reason not to be using 64-bit Java? It will handle larger memory sizes much better than 32-bit Java.
Doug
But if you have 6GB of addressable RAM, then I think you must be running a 64-bit OS (it's not very clear to me from what you posted - I think you should run "uname -m" to clarify this). If you are on a 64-bit OS, then is there any reason not to be using 64-bit Java? It will handle larger memory sizes much better than 32-bit Java.
Doug
ASKER
here is the output for uname -m
[root@ora-dev15-ebs ~]#uname -m
i686
[root@ora-dev15-ebs ~]#
Rebooting the server needs approval, is there any other way to allocate contiguous space without a reboot.
[root@ora-dev15-ebs ~]#uname -m
i686
[root@ora-dev15-ebs ~]#
Rebooting the server needs approval, is there any other way to allocate contiguous space without a reboot.
Just because the computer has 6 GB memory doesn't mean it is 64 bit. The 32bit restrictions were with the original 32 bit hardware, with PAE a 32 bit RHEL system can use 16 GB of ram. From the uname -a above this is what the OP has.
See this: http://h10025.www1.hp.com/ ewfrf/wc/d ocument?cc =us&lc=en& dlc=en&doc name=c0245 6298
Can you post output of : cat /proc/meminfo
See this: http://h10025.www1.hp.com/
Can you post output of : cat /proc/meminfo
ASKER
here is the meminfo output
[root@ora-dev15-ebs ~]# cat /proc/meminfo
MemTotal: 8259888 kB
MemFree: 6278372 kB
Buffers: 127876 kB
Cached: 684912 kB
SwapCached: 0 kB
Active: 1280148 kB
Inactive: 485256 kB
Active(anon): 958964 kB
Inactive(anon): 644 kB
Active(file): 321184 kB
Inactive(file): 484612 kB
Unevictable: 8096 kB
Mlocked: 8096 kB
HighTotal: 7481288 kB
HighFree: 5821056 kB
LowTotal: 778600 kB
LowFree: 457316 kB
SwapTotal: 10485752 kB
SwapFree: 10485752 kB
Dirty: 136 kB
Writeback: 0 kB
AnonPages: 960704 kB
Mapped: 52180 kB
Shmem: 132 kB
Slab: 169668 kB
SReclaimable: 144688 kB
SUnreclaim: 24980 kB
KernelStack: 5776 kB
PageTables: 9112 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 14615696 kB
Committed_AS: 1782504 kB
VmallocTotal: 122880 kB
VmallocUsed: 6712 kB
VmallocChunk: 99056 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 10232 kB
DirectMap2M: 897024 kB
[root@ora-dev15-ebs ~]#
[root@ora-dev15-ebs ~]# cat /proc/meminfo
MemTotal: 8259888 kB
MemFree: 6278372 kB
Buffers: 127876 kB
Cached: 684912 kB
SwapCached: 0 kB
Active: 1280148 kB
Inactive: 485256 kB
Active(anon): 958964 kB
Inactive(anon): 644 kB
Active(file): 321184 kB
Inactive(file): 484612 kB
Unevictable: 8096 kB
Mlocked: 8096 kB
HighTotal: 7481288 kB
HighFree: 5821056 kB
LowTotal: 778600 kB
LowFree: 457316 kB
SwapTotal: 10485752 kB
SwapFree: 10485752 kB
Dirty: 136 kB
Writeback: 0 kB
AnonPages: 960704 kB
Mapped: 52180 kB
Shmem: 132 kB
Slab: 169668 kB
SReclaimable: 144688 kB
SUnreclaim: 24980 kB
KernelStack: 5776 kB
PageTables: 9112 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 14615696 kB
Committed_AS: 1782504 kB
VmallocTotal: 122880 kB
VmallocUsed: 6712 kB
VmallocChunk: 99056 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 10232 kB
DirectMap2M: 897024 kB
[root@ora-dev15-ebs ~]#
Hmmm, you have plenty of swap left, Lets try this:
-XX:MaxPermSize=512m -Xms1583m -Xmx1583m
-XX:MaxPermSize=512m -Xms1583m -Xmx1583m
ASKER
no luck :(
java -XX:MaxPermSize=512m -Xms1583m -Xmx1583m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
java -XX:MaxPermSize=512m -Xms1583m -Xmx1583m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Okay I am running out of ideas, but lets try this:
Run following three commands for me and post the output.
1 : cat /proc/user_beancounters
2 : java -XX:MaxPermSize=512m -Xms1583m -Xmx1583m -version
3 : cat /proc/user_beancounters
Run following three commands for me and post the output.
1 : cat /proc/user_beancounters
2 : java -XX:MaxPermSize=512m -Xms1583m -Xmx1583m -version
3 : cat /proc/user_beancounters
ASKER
here is the output
[root@ora-dev15-ebs ~]# cat /proc/user_beancounters
cat: /proc/user_beancounters: No such file or directory
[root@ora-dev15-ebs ~]# java -XX:MaxPermSize=512m -Xms1583m -Xmx1583m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
[root@ora-dev15-ebs ~]# cat /proc/user_beancounters
cat: /proc/user_beancounters: No such file or directory
[root@ora-dev15-ebs ~]#
[root@ora-dev15-ebs ~]# cat /proc/user_beancounters
cat: /proc/user_beancounters: No such file or directory
[root@ora-dev15-ebs ~]# java -XX:MaxPermSize=512m -Xms1583m -Xmx1583m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
[root@ora-dev15-ebs ~]# cat /proc/user_beancounters
cat: /proc/user_beancounters: No such file or directory
[root@ora-dev15-ebs ~]#
You can run java-1.x.0-openjdk up to ~2.8GB heap
Or jrockit (support contract needed) to 4095M heap
Generic oracle java is no good for 32bit systems
Or jrockit (support contract needed) to 4095M heap
Generic oracle java is no good for 32bit systems
kernel -Xms=2700M
kernel-PAE 2700M
kernel-uek 2600M
java = 1.7.0.51-2.4.4.2.0.1_el5_1 0
kernel-uek = 2.6.39-300.26.1
orhers = 2.6.18-371.4.1.el5
kernel-PAE 2700M
kernel-uek 2600M
java = 1.7.0.51-2.4.4.2.0.1_el5_1
kernel-uek = 2.6.39-300.26.1
orhers = 2.6.18-371.4.1.el5
ASKER
Thanks for your response. But as i mention in the beginning the same generic oracle java working absolutely fine with 2gig heap memory on another 32bit server.
I'd say upgrade the UEK kernel or go with "latest" RedHat-compatible
As you see I had no problems getting the heap you need.
As you see I had no problems getting the heap you need.
there are limits on heap size
what if you set Xmx to 1G - does it still fail?
you may not be able to set the heap size that high on 32bit architecture