Reputation:
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?
Upvotes: 15
Views: 30029
Reputation: 45
Goto project Properties window. set addition compiler option in Build>Compiling tab to -Xmx512m
Upvotes: 0
Reputation:
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....
Upvotes: 0
Reputation:
try on Tools -> Servers -> on the Platform tab there is a VM option below Java Platform.
Upvotes: 2
Reputation: 44103
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
Upvotes: 1
Reputation: 48255
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
).
Upvotes: 22
Reputation: 14004
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).
Upvotes: 1