问题描述
我在使用 netbeans 和 Java 时遇到了问题.我的程序需要能够处理通过数组列表上传的大文件.所以我使用 -Xmx512m 通过 netbeans.conf 文件增加最大堆大小.
I'm having an issue with netbeans and Java. My program needs to be able to cope with large files being uploaded via an arraylist. So I used -Xmx512m to increase the maximum heap size via the netbeans.conf file.
我知道 netbeans 正在捕捉变化,我已经多次重新启动以确保它是.尽管如此,当总内存参数仅为 66650112 字节时,我的程序继续因 Java 堆空间内存错误而崩溃;也就是说,64M-ish.
I know that netbeans is catching the change, and I've restarted multiple times to make sure it is. Still, my program continues to crash with a Java heap space memory error when the total memory parameter is only 66650112 bytes; that is, 64M-ish.
我怎样才能强制这个特定的类、过程等允许更多的内存分配?
How can I force this particular class, procedure, whatever, to allow more memory allocation?
推荐答案
我认为您只是配置了 netbeans IDE 本身的最大堆大小,而不是您的程序.
I think you just configured the maximum heap size of netbeans IDE itself and not your program.
转到您的项目属性",选择运行"类别.在VM 选项"文本框中输入您的参数 (-Xmx512m
).
Go to your project "properties", select "Run" category. In the "VM Options" text box put your arguments (-Xmx512m
).
这篇关于netbeans 中的 Java 堆空间……但我已经增加了堆大小!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!