The use of Java applications on computers requires a memory called Java memory ("Java heap"). Often, it is necessary to increase this memory to avoid slowing down the operation of the application. Here's how to do it in Windows 7.
Steps
Step 1. Go to the Control Panel
Click on "Start", then on "Control Panel".
Step 2. Select “Programs”
In the left column of the Control Panel click on "Programs", the one written in green, Not the "Uninstall a program" written in blue.
Step 3. Go to Java settings
In the following window, click on "Java", usually at the bottom of the other programs; The "Java Control Panel" window will open.
Step 4. Choose the “Java” panel
In the Java panel, click on the "View" button. The "Java Runtime Environment Settings" will open.
Step 5. Change the amount of space
In the parameter column ("Runtime Parameters") change the value, or if it is empty, decide the new value of the Java memory.
Step 6. Edit the parameter
To modify it, double click on the parameter column and then,
- type -Xmx512m to dedicate 512MB of memory for Java.
- type -Xmx1024m to dedicate 1GB of memory for Java.
- type -Xmx2048m to dedicate 2GB of memory for Java.
- type -Xmx3072m to dedicate 3GB of memory for Java, and so on.
- Watch out for the initial minus sign and the final "m".
- Also note the absence of spaces between letters and numbers.
Step 7. Close the window
Click on "OK" in the Java settings to close them.
Step 8. Close the Java window
The "Apply" button in the "Java Control Panel" is now active. You should click on “Apply” to activate the new Java memory. Then click "OK".
Step 9. Close the Windows 7 Control Panel
Advice
- It is not necessary to restart the computer after changing the Java memory.
- The value you choose depends on how much memory your computer has and how much is being consumed by all running processes.
- This is a 'temporary' amount of memory available to Java applications while you use them. It does not "steal" or permanently steal memory from your computer. It is only a guarantee for the Java Virtual Machine.
- If Java can't find enough memory, it throws an "exception" message to Windows, like this: "Exception in thread" main "java.lang. OutOfMemoryError: Java heap space."
- This method also works with Windows 8.
- This method, with some modifications, can also be used in Windows XP.