Solved

Could not reserve enough space for object heap, Could not create the Java virtual machine on RHEL 5.10

Posted on 2014-04-03
16
3,435 Views
Last Modified: 2014-04-28
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
0
Comment
Question by:sudhirgoogle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 3
  • +2
16 Comments
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39976025
you are running 32bit java on 32bit linux
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
0
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 39976109
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 ~]#
0
 
LVL 9

Accepted Solution

by:
sanjooz earned 500 total points
ID: 39976651
The JVM will allocate contiguous virtual memory for heap, so how much you can allocate can depend on what else is going on with your memory. Address space fragmentation and usage by the OS will influence how much you can allocate.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 1

Author Comment

by:sudhirgoogle
ID: 39976748
is there any other alternate method to allocate contiguous virtual memory for heap? somehow i must allocate memory around 2gig. Please help.
0
 
LVL 28

Expert Comment

by:dpearson
ID: 39977282
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
0
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 39977814
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.
0
 
LVL 9

Expert Comment

by:sanjooz
ID: 39978175
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/document?cc=us&lc=en&dlc=en&docname=c02456298



Can you post output of : cat /proc/meminfo
0
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 39978775
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 ~]#
0
 
LVL 9

Expert Comment

by:sanjooz
ID: 39978848
Hmmm, you have plenty of swap left, Lets try this:

-XX:MaxPermSize=512m -Xms1583m -Xmx1583m
0
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 39978985
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.
0
 
LVL 9

Expert Comment

by:sanjooz
ID: 39979036
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
0
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 39979038
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 ~]#
0
 
LVL 62

Expert Comment

by:gheist
ID: 39979276
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
0
 
LVL 62

Expert Comment

by:gheist
ID: 39979628
kernel -Xms=2700M
kernel-PAE 2700M
kernel-uek 2600M

java = 1.7.0.51-2.4.4.2.0.1_el5_10
kernel-uek = 2.6.39-300.26.1
orhers = 2.6.18-371.4.1.el5
0
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 39980235
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.
0
 
LVL 62

Expert Comment

by:gheist
ID: 39986943
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.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This video teaches viewers about errors in exception handling.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question