I have a Netbeans Platform modular project, not a regular Java project. I want to set VM options to increase memory, but under the \"properties\" dialog, there is no way to
you have to add these lines to your project properties file.
<target name="build-launchers" depends="suite.build-launchers">
<replace file="build/launcher/etc/${app.name}.conf" token="--branding graphsimulator -J-Xms24m -J-Xmx64m" value="--branding graphsimulator -J-Xms128m -J-Xmx512m"/>
</target>
I had this issue and after some digging around and reading a lot of docs I was able to deduce that most of those values were coming from templates in the harness.
So if you go to your IDE_home/harness/etc/ you will find the "app.conf" file. This file is renamed during a distro build and the "app.conf" becomes your "application name.conf". Edit this file with the default values you would like in you application.
In my case I replaced the line that read: default_options="--branding ${branding.token} -J-Xms24m -Xmx64m" with default_options="--branding ${branding.token} -J-Xms64m -Xmx512m" as my application was needing more memory. By changing the template I dont have to touch every deployment and change the memory CLI for the VM.
Hope this helps!
If you want to use Netbeans to set the VM options without bothering about which file to edit, here we go:
Run -> Set project configuration -> VM Options
Add your option in the corresponding text box for example: -Xms10m
To answer user1156544
doubt:
I was finally able to solve this based on information at http://activeintelligence.org/blog/archive/gephi-increasing-xmx-memory-in-netbeans/
What I did was modify the project.properties file, as JB said, but the correct way to do it was to add a -J before the args. E.g.,
run.args.extra=-J-Xms256m -J-Xmx756m
That did it! Not sure why it took 3 months to figure that out. Definitely a fail for the Netbeans documentation. They should really make this editable from the properties menu instead of making users hunt through nondescript config files!
As described in this question, you can use etcConfFile parameter of nbm-maven-plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<configuration>
<etcConfFile>src/main/resources/app.conf</etcConfFile>
</configuration>
</plugin>
More info: Geertjan's Blog
It is quite easy, in fact. Just modify project.properties file to include the following line:
Edited:
run.args.extra=-J-Xmx768m
Of course, you can include any other JVM options there.
Enjoy.