4

I'm trying to assign to the jvm of Netbeans more than 1 gb of RAM, without success. I have a very huge maven project to work on and netbeans goes out of memory immediately after the open of all the projects.

I'm work on a Gentoo linux:

 Linux myHost 3.2.12-gentoo #3 SMP Mon Jul 2 14:27:56 CEST 2012 i686
 Intel(R) Xeon(R) CPU E31245 @ 3.30GHz GenuineIntel GNU/Linux

$ 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) 129570
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) 129570
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Memory of my box is:

# cat /proc/meminfo 
MemTotal:       16585504 kB
MemFree:        11731232 kB
...

when I set -J-Xmx3024m I obtain these messages:

/opt/netbeans-7.2/bin/netbeans 
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Thanks!

2
  • How much Ram does your box got?
    – Mukul Goel
    Dec 3, 2012 at 14:45
  • 1
    On 32 bit linux, 3Gb address space is available to a single process, no matter how much ram you have. And you need some extra space for the libraries the JVM uses, permgen space, etc. So you have to assign less than 3Gb for the heap.
    – nos
    Dec 3, 2012 at 14:54

1 Answer 1

4

you can refer to Maximum Java heap size of a 32-bit JVM on a 64-bit OS , for how the limits on max heap size are determined. it does not mean if you got 99GB of RAM on your box, you can assign say 90Gigs to JVM

Also, it depends on how much memory you have free, your OS, then netbeans, your server, they will require some amount of memory too. You can only assign the available amount of memory to your JVM

The message Could not reserve enough space for object heap means that 3024 MB is not available for assignment. Try reducing it

looks like on linux, max allowed memory per procesd is 3gigs. Though you can not allot that all to jvm heap, as it require memory for premGem etc as well. The thread i mentioned above..a post in there says that, he was successful with 2.2 gb.

2
  • This is the maximum RAM I can give to netbeans. To way to obtain more. netbeans_default_options="-J-client -J-Xss2m -J-XX:PermSize=512m -J-XX:MaxPermSize=512m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true -J-Xms2148m -J-Xmx2148m -J-XX:+UseParallelGC"
    – Stefania
    Dec 4, 2012 at 9:34
  • edit to above comment , in a code block : ``This is the maximum RAM I can give to netbeans. To way to obtain more. netbeans_default_options="-J-client -J-Xss2m -J-XX:PermSize=512m -J-XX:MaxPermSize=512m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true -J-Xms2148m -J-Xmx2148m -J-XX:+UseParallelGC"
    – Mukul Goel
    Dec 4, 2012 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.