We have a problem with a java application running out of memory. Our (Windows XP) client PCs have JRE 1.6 version 18 installed. I want to increase the -Xmx runtime parameter for the JRE to 512M but I can't seem to set this for all users. When I log in to the PC as Administrator and set the Runtime parameters in the Java Console, these settings only appear for my login.
Maybe you can try modifying a System Deployment Properties file? Short version of usage below:
- You need to create a file named
deployment.configand put it in either
%SystemRoot%\Sun\Java\Deploymentor your JRE's
deployment.configcontains a pointer to a
deployment.propertiesfile, as below:
deployment.propertiesfile contains the properties that you want to set system-wide, one per line. For my organization, we occasionally have problems with the JRE's caching causing problems, so I disable it with
deployment.cache.enabled=falseand prevent users from changing the value with
deployment.cache.enabled.locked=If you're not sure about the syntax, make the changes for yourself and look at the
deployment.propertiesfile normally located in
C:\Documents and Settings\<username>\Local Settings\Application Data\Sun\Java\Deployment. At least, I think that's the path in XP. On my Win 7 system it's in
I don't know if you can set the JRE options like this, but it's worth a shot.
That's perfect, thanks. I had been changing the
C:\Documents and Settings\<username>\Local Settings\Application Data\Sun\Java\Deployment. But this is a simple solution for all users May 18, 2011 at 16:19
For anyone implementing this, it's worth noting that setting this seems to override any user-specific settings May 18, 2011 at 16:21
deployment.configuses an URL to point at the
.propertiesfile, it's possible to host the file on an intranet server and have clients retrieve the file via HTTP. You still have to deploy the
.configthough.– afrazierMay 18, 2011 at 18:18
1Thanks again. For anyone else trying to do this, copy the
deployment.propertiesfile from your
Application Data\Sun\Java\Deploymentfolder into your
%SystemRoot%\Sun\Java\Deploymentfolder. Then add the following line:
deployment.javaws.jre.0.args=-Xms64m -Xmx512m. The '0' corresponds to the JRE you want to set these parameters for. It may be different, i.e. 1,2 etc., it depends how many JREs you have installed. It will be clear from the other lines in the file which number JRE you want. May 18, 2011 at 20:58
I think it's wrong to accept an answer that only provides solution for one platform. Even if the question it self asked for Windows, people from other systems might still read this in future. For them it's almost useless information.– KasparSep 26, 2017 at 12:42
JAVA_OPTIONS environment variable to store the runtime options that will be used by the JVM during startup.
As far as setting this across users is concerned, you could do this via a logon script or via the Windows registry.
Given the presence of a Java applet, it would be worthwhile to investigate whether Java 6 Update 10 or higher versions of the Java runtime could be installed on desktop PCs. Additionally, one would also have to specify the desired Xmx value using the java_arguments parameter to the applet; this parameter was introduced in 6u10. This might not be so trivial in the case of Oracle Forms 10g, as it requires editing of the web page where the applet is loaded from, but is worth a try.
See the related StackOverflow question for more details.
Thanks for your response. I've tried setting windows environment variables
JAVA_OPTS. None of them seem to be getting picked up by the JVM (I'm checking this by looking at the
javaplugin.vm.optionsvalue when I hit 's' in the java console). I should mention that the Java application is actually an applet. Oracle Forms 10g. May 18, 2011 at 14:46
Ah ok, applets work differently; I've edited the answer now. May 18, 2011 at 15:54
Thanks Vineet, the jre is 6u18. The easiest solution seems to be the one offered by afrazier below. Thanks for your help May 18, 2011 at 16:17
Thanks for the tip about
JAVA_TOOL_OPTIONS. I completely wasted the weekend trying to get Processing to use Unicode characters (despite its claims that it already does) and none of the 30+ things I tried worked… until this. Thank you!– SynetechNov 29, 2015 at 22:11
The Windows environmental variable is called
deployment.properties file is the same as starting
System Properties ->
Java -> (Tab)
Java -> (Button)
View and modifying the runtime parameter table entry.