Discussion:
Specifying default JVM arguments such as -J-Xmx for the generated installer
Robert Ratcliff
2011-03-22 21:42:20 UTC
Permalink
I noticed that the default memory set in the myapp/etc/myapp.conf file
is 64M using a generated installer from NetBeans (which is very cool by
the way).



Is there a way to tell the NetBeans platform installer-generator to
change the default values to something else? (I'd like to avoid having a
post processing step after installation.)



Thanks,



Rob
J***@bbraun.com
2011-03-22 21:46:35 UTC
Permalink
This is what I do. I basically hack into the the build-zip process:

<target name="build-zip" depends="suite.build-zip">
<unzip src="${dist.dir}/${app.name}.zip" dest="${dist.dir}"/>
<replace file="${dist.dir}/${app.name}/etc/${app.name}.conf">
<replacefilter token="/dev" value="/${app.version}" />
<replacefilter token="-J-Xms24m -J-Xmx64m"
value="${run.args.extra}" />
</replace>
<delete file="${dist.dir}/${app.name}.zip"/>
<zip destfile="${dist.dir}/${app.name}.zip"
basedir="${dist.dir}"/>
<delete dir="${dist.dir}/${app.name}"/>
</target>

Hope it helps.

Javier A. Ortiz Bultrón
Quality Assurance Engineer
B.Braun Medical, Inc.
972-466-5076 Phone
********************************************************************************
The information contained in this communication is confidential, may be
attorney-client privileged, may constitute inside information, and is intended
only for the use of the addressee. It is the property of the company of the
sender of this e-mail. Unauthorized use, disclosure, or copying of this
communication or any part thereof is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us immediately
by return e-mail and destroy this communication and all copies thereof,
including all attachments.
********************************************************************************
Xavier Callejas
2011-03-22 22:09:07 UTC
Permalink
I noticed that the default memory set in the myapp/etc/myapp.conf file is
64M using a generated installer from NetBeans (which is very cool by the
way).
Is there a way to tell the NetBeans platform installer-generator to change
the default values to something else? (I’d like to avoid having a post
processing step after installation.)
You can provide a custom configuration file for your project, open your
properties file (project.properties) of your suite (your suite not your
module) and add:

app.conf=nbproject/myapp.conf

where "nbproject/myapp.conf" is the path (relative path in my case) of your
file.

You could use the default generated conf file and then custumizate it and copy
to the nbproject.
Damian Carey
2011-03-22 22:09:15 UTC
Permalink
Rob

I do the following on Windows ...

1. Open C:\Program Files (x86)\NetBeans 6.9\harness\etc\app.conf
2. Change "-J-Xmx64m" to "-J-Xmx300m"

Depending on your permissions / setup you might need to copy the app.conf
file elsewhere (perhaps to the desktop - or anywhere you have edit
permissions), edit it, then copy it back.

Your "MyApp.conf" is actually created by copying from the "app.conf" above.

Cheers,
-Damian
I noticed that the default memory set in the myapp/etc/myapp.conf file is
64M using a generated installer from NetBeans (which is very cool by the
way).
Is there a way to tell the NetBeans platform installer-generator to change
the default values to something else? (I’d like to avoid having a post
processing step after installation.)
Thanks,
Rob
Alied Pérez Martínez
2011-03-23 13:03:20 UTC
Permalink
The thing is, when the zip dist is generated, it uses the default conf
file. What I did (and I saw it in some forum or blog I can't recall)
is to do this task in the suite's build script:

<target name="build-launchers" depends="suite.build-launchers">
<!--run.args.extra=-J-Xss512k -J-Xms64m -J-Xmx256m -J-XX:PermSize=32m
-J-XX:MaxPermSize=128m -J-XX:MaxHeapFreeRatio=50 -J-Xverify:none
-J-Djava.net.preferIPv4Stack=true -J-XX:CompileThreshold=100
-J-Dsun.java2d.d3d=true -J-Dsun.java2d.noddraw=false
-J-Dsun.java2d.ddoffscreen=true -J-Dsun.java2d.ddscale=true
-J-Dsun.java2d.translaccel=true -J-Dj3d.rend=d3d-->
<echo message="Updating conf defaults for branding"/>
<echo file="${build.launcher.dir}/etc/${app.name}.conf">
# ${HOME} will be replaced by user home directory according to platform
default_userdir="${HOME}/.${app.name}/dev"
default_mac_userdir="${HOME}/Library/Application Support/.${app.name}/dev"

# options used by the launcher by default, can be overridden by explicit
# command line switches
default_options="--branding ${branding.token} --J-server -J-Xss2m
-J-Xms32m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=512m
-J-XX:MaxHeapFreeRatio=50 -J-Xverify:none
-J-Djava.net.preferIPv4Stack=true -J-XX:CompileThreshold=100"
# for development purposes you may wish to append:
-J-Dnetbeans.logger.console=true -J-ea

# default location of JDK/JRE, can be overridden by using --jdkhome
#jdkhome="/path/to/jdk"

# clusters' paths separated by path.separator (semicolon on Windows,
colon on Unices)
#extra_clusters=
</echo>
</target>

Basically what it does is to dump the conf file from the script.
I hope it helps.
Post by Damian Carey
Rob
I do the following on Windows ...
1. Open C:\Program Files (x86)\NetBeans 6.9\harness\etc\app.conf
2. Change "-J-Xmx64m" to "-J-Xmx300m"
Depending on your permissions / setup you might need to copy the app.conf
file elsewhere (perhaps to the desktop - or anywhere you have edit
permissions), edit it, then copy it back.
Your "MyApp.conf" is actually created by copying from the "app.conf" above.
Cheers,
-Damian
I noticed that the default memory set in the  myapp/etc/myapp.conf file is
64M using a generated installer from NetBeans (which is very cool by the
way).
Is there a way to tell the NetBeans platform installer-generator to change
the default values to something else? (I’d like to avoid having a post
processing step after installation.)
Thanks,
Rob
--
There are only 10 types of people in the world —
those who understand binary, and those who don't.
Loading...