Question

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.

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?

Was it helpful?

Solution

I think you just configured the maximum heap size of netbeans IDE itself and not your program.

Go to your project "properties", select "Run" category. In the "VM Options" text box put your arguments (-Xmx512m).

OTHER TIPS

try on Tools -> Servers -> on the Platform tab there is a VM option below Java Platform.

I believe editing netbeans.conf only changes the maximum the JVM that runs the IDE can use. You'll need to change the project configuration for your program (Because it probably runs in a different Java VM).

Check out this link for the NetBeans help on setting project properties and in particular the properties for running a project.

VM Options is where you need to add the -Xmx512m

VM Options is where you need to add the -Xmx512m.....

as well as -Xms512m

since:

-Xms512m -> initial Java heap size -Xmx512m -> max Java heap size

thus you would add, in your case: -Xmx512m -Xms512

in the VM options textfield....

Goto project Properties window. set addition compiler option in Build>Compiling tab to -Xmx512m

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top