Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 6 down vote accepted

Maybe you can try modifying a System Deployment Properties file? Short version of usage below:

  1. You need to create a file named deployment.config and put it in either %SystemRoot%\Sun\Java\Deployment or your JRE's \lib\ directory.
  2. The deployment.config contains a pointer to a deployment.properties file, as below:

    deployment.system.config=file\:C\:/Windows/Sun/Java/Deployment/deployment.properties

  3. The deployment.properties file 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=false and 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.properties file 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 AppData\LocalLow\Sun\Java\Deployment.

I don't know if you can set the JRE options like this, but it's worth a shot.

share|improve this answer
    
That's perfect, thanks. I had been changing the deployment.properties file in C:\Documents and Settings\<username>\Local Settings\Application Data\Sun\Java\Deployment. But this is a simple solution for all users –  steviey May 18 '11 at 16:19
    
For anyone implementing this, it's worth noting that setting this seems to override any user-specific settings –  steviey May 18 '11 at 16:21
    
Also, since deployment.config uses an URL to point at the .properties file, 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 .config though. –  afrazier May 18 '11 at 18:18
    
Thanks again. For anyone else trying to do this, copy the deployment.properties file from your Application Data\Sun\Java\Deployment folder into your %SystemRoot%\Sun\Java\Deployment folder. 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. –  steviey May 18 '11 at 20:58

The Windows environmental variable is called JAVA_TOOL_OPTIONS.

The deployment.properties file is the same as starting System Properties -> Java -> (Tab) Java -> (Button) View and modifying the runtime parameter table entry.

share|improve this answer

Use the 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.

Edit:

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.

share|improve this answer
    
Thanks for your response. I've tried setting windows environment variables JAVA_OPTIONS, _JAVA_OPTIONS and JAVA_OPTS. None of them seem to be getting picked up by the JVM (I'm checking this by looking at the javaplugin.vm.options value when I hit 's' in the java console). I should mention that the Java application is actually an applet. Oracle Forms 10g. –  steviey May 18 '11 at 14:46
    
Ah ok, applets work differently; I've edited the answer now. –  Vineet Reynolds May 18 '11 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 –  steviey May 18 '11 at 16:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.