简体   繁体   English

如何为netbeans JVM分配超过1GB的空间?

[英]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. 我正在尝试为Netbeans的jvm分配超过1 GB的RAM,但没有成功。 I have a very huge maven project to work on and netbeans goes out of memory immediately after the open of all the projects. 我有一个非常庞大的maven项目,并且netbeans在所有项目打开后立即内存不足。

I'm work on a Gentoo linux : 我正在使用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: 当我设置-J-Xmx3024m我获取以下消息:

/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! 谢谢!

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. 您可以参考64位操作系统上32位JVM的最大Java堆大小 ,以了解如何确定最大堆大小的限制。 it does not mean if you got 99GB of RAM on your box, you can assign say 90Gigs to JVM 这并不意味着如果你的盒子上有99GB的RAM,你可以将90Gigs分配给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. 此外,它取决于你有多少内存,你的操作系统,然后netbeans,你的服务器,他们也需要一些内存。 You can only assign the available amount of memory to your JVM 您只能为JVM分配可用的内存量

The message Could not reserve enough space for object heap means that 3024 MB is not available for assignment. 消息Could not reserve enough space for object heap意味着3024 MB不可用于分配。 Try reducing it 尝试减少它

looks like on linux, max allowed memory per procesd is 3gigs. 看起来像在Linux上,每个进程的最大允许内存是3gigs。 Though you can not allot that all to jvm heap, as it require memory for premGem etc as well. 虽然你不能将所有内容分配给jvm堆,因为它也需要内存用于premGem等。 The thread i mentioned above..a post in there says that, he was successful with 2.2 gb. 我在上面提到的帖子......那里的帖子说,他用2.2 gb成功了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM