LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-12-2010, 11:21 AM   #1
Lorian
LQ Newbie
 
Registered: Sep 2005
Distribution: Gentoo
Posts: 25

Rep: Reputation: 15
Java "Could not reserve enough space for object heap"


Hi all,

I'm having trouble setting Java up on my virtual private server. It works fine when running under root, but if I run it under a normal user account I get this error message:
Quote:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Presumably the memory allowed to be used is being limited, but I can't figure out how to change it. I've tried adjusting the -Xmx argument, but the highest value at which it will work is 18MB, which is not enough.

This is the ulimit output for the root and user accounts respectively:
Code:
# ulimit -a
core file size          (blocks, -c) 1000000
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 139264
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 4096
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) 14335
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
Code:
$ ulimit -a
core file size          (blocks, -c) 200000
data seg size           (kbytes, -d) 200000
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 139264
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) 200000
open files                      (-n) 100
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) 20
virtual memory          (kbytes, -v) 200000
file locks                      (-x) unlimited
I suspect the problem is due to the virtual memory, but there doesn't appear to be any way to set the value in limits.conf. If I manually lower it to 200000kB under root I get the same error message.

Any help would be appreciated.

Thanks.

Edit: I'm using Red Hat x86_64, kernel 2.6.18-028stab070.2.
 
Old 09-12-2010, 04:47 PM   #2
Lorian
LQ Newbie
 
Registered: Sep 2005
Distribution: Gentoo
Posts: 25

Original Poster
Rep: Reputation: 15
Figured it out. cPanel has injected code in various places to set the ulimit values; the following files need to be adjusted to change these values:

/etc/profile
/etc/bashrc
/etc/profile.d/limits.sh
 
Old 06-12-2012, 07:11 PM   #3
sahni_h
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: Disabled
Hey, can you explain how exactly you went about fixing this as I am running into the EXACT same problem. I am also running the same linux server and using cpanel.

What exactly do I edit in those files? I cannot even find those files in the etc directory.

I can find bashrc and bash_profile in my home directory but don't know what to do with them.

Any help will be greatly appreciated. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Java - "Type mismatch: cannot convert from element type Object to int[]" Infasoft Programming 2 07-09-2010 01:06 PM
Can't locate object method "splitpath" via package "PACK001" at /usr/lib/perl5/5.8.8/ sajigeorge Linux - Software 1 01-11-2009 06:33 AM
on the boot I'm getting message "PCI: Unable to reserve.." but everything is okay? trancephorm Linux - Newbie 0 11-06-2004 07:03 PM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
Can't locate object method "splitpath" via package "File::Spec" RobJohnston Linux - General 2 06-28-2003 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration