Stefania
Stefania

Reputation: 683

How to assign more than 1gb to netbeans JVM?

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!

Upvotes: 4

Views: 4138

Answers (1)

Mukul Goel
Mukul Goel

Reputation: 8467

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.

Upvotes: 4

Related Questions