Difference between revisions of "How to Increase Java Memory in Windows"

From Dysprosium
Jump to navigation Jump to search
(Creating Page)
 
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
Running Java applications in computers takes some memory during the process which is known as Java memory (Java heap). Frequently, it is necessary to increase that heap to prevent throttling the performance of the application. This is how to for Windows 7.
Running Java applications in computers takes some memory during the process which is known as Java memory (Java heap). Frequently, it is necessary to increase that heap to prevent throttling the performance of the application. This is how to for Windows 7 and can be used in Windows XP and Windows 8/8.1.
[[Category:Windows 7]]
[[Category:Computer Skills]]
[[Category:Java]]
== Steps ==
== Steps ==
# [[Image:WikiHowJavaHeap_1.PNG|right|179px|thumb|Start Button]]Go to Control Panel. Click on "Start" button. Then click on "Control Panel."
# Go to Control Panel. Click on "Start" button. Then click on "Control Panel." [[Image:WikiHowJavaHeap_1.PNG|center|200px|thumb|Start Button]]
# [[Image:WikiHowJavaHeap_2.PNG|center|404px|thumb|Find Programs]]Select Programs. In the left side of Control Panel click on "Programs." Pleas click on the "Programs" written with green color, '''not''' the "Uninstall a program," which is in blue color.
# Select Programs. In the left side of Control Panel click on "Programs." Pleas click on the "Programs" written with green color, '''not''' the "Uninstall a program," which is in blue color. [[Image:WikiHowJavaHeap_2.PNG|center|500px|thumb|Find Programs]]
# [[Image:WikiHowJavaHeap_3.PNG|center|404px|thumb|Find Java]]Go to Java settings. In the next dialog click on "Java," usually at the bottom of the other Programs; "Java Control Panel" dialog pop-up opens.
# Go to Java settings. In the next dialog click on "Java," usually at the bottom of the other Programs; "Java Control Panel" dialog pop-up opens. [[Image:WikiHowJavaHeap_3.PNG|center|500px|thumb|Find Java]]
# [[Image:WikiHowJavaHeap_4.PNG|right|182px|thumb|Find Java Tab]]Select "Java" tab. Inside the Java tab, click on "View" button. It opens the "Java Runtime Environment Settings"
# Select "Java" tab. Inside the Java tab, click on "View" button. It opens the "Java Runtime Environment Settings" [[Image:WikiHowJavaHeap_4.PNG|center|350px|thumb|Find Java Tab]]
# [[Image:WikiHowJavaHeap_5.PNG|right|178px|thumb|View Java Runtime Environment]]Change amount of heap. In the "Runtime Parameters" column change the value, or if it is blank decide for the new value, of the Java memory.
# Change amount of heap. In the "Runtime Parameters" column change the value, or if it is blank decide for the new value, of the Java memory. [[Image:WikiHowJavaHeap_5.PNG|center|350px|thumb|View Java Runtime Environment]]
# [[Image:WikiHowJavaHeap_6.PNG|center|399px|thumb|Modify Runtime Parameter]]Modify the parameter. To modify the parameter, double click in the "Runtime Parameters" column and,
# Modify the parameter. To modify the parameter, double click in the "Runtime Parameters" column and, [[Image:WikiHowJavaHeap_6.PNG|center|500px|thumb|Modify Runtime Parameter]]
#* type -Xmx512m that assigns 512MB memory for the Java.
#* type -Xmx512m that assigns 512MB memory for the Java.
#* type -Xmx1024m that assigns 1GB memory for the Java.
#* type -Xmx1024m that assigns 1GB memory for the Java.
#* type -Xmx2048m that assigns 2GB memory for the Java.
#* type -Xmx2048m that assigns 2GB memory for the Java.
#* type -Xmx3072m that assigns 2GB memory for the Java, and so on.
#* type -Xmx3072m that assigns 3GB memory for the Java, and so on.
#* Please note, it begins with a minus sign and ends to an m.
#* Please note, it begins with a minus sign and ends to an m.
#* Also note, there is no blank space between characters.
#* Also note, there is no blank space between characters.
Line 25: Line 24:
*If Java cannot find enough memory it dispatches an "exception" message to the Windows as, "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space."
*If Java cannot find enough memory it dispatches an "exception" message to the Windows as, "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space."
*This method with some modification also can be used for Windows Xp
*This method with some modification also can be used for Windows Xp
*This method also can be used for Windows 8 (not in the market at this date).
*This method also can be used for Windows 8 and Windows 10.


== Related wikiHows ==
== Related How To's ==
*[[Adjust Virtual Memory|How to Adjust Virtual Memory]]
*[[Dramatically Speed up Windows XP|How to Dramatically Speed up Windows XP]]
*[[Increase Laptop Memory|How to Increase Laptop Memory]]
*[[Install Windows 7 on a Laptop|How to Install Windows 7 on a Laptop]]
*[[Test Network and Internet Latency (Lag) in Microsoft Windows|How to Test Network and Internet Latency (Lag) in Microsoft Windows]]

Latest revision as of 08:47, 13 May 2016

Running Java applications in computers takes some memory during the process which is known as Java memory (Java heap). Frequently, it is necessary to increase that heap to prevent throttling the performance of the application. This is how to for Windows 7 and can be used in Windows XP and Windows 8/8.1.

Steps

  1. Go to Control Panel. Click on "Start" button. Then click on "Control Panel."
    Start Button
  2. Select Programs. In the left side of Control Panel click on "Programs." Pleas click on the "Programs" written with green color, not the "Uninstall a program," which is in blue color.
    Find Programs
  3. Go to Java settings. In the next dialog click on "Java," usually at the bottom of the other Programs; "Java Control Panel" dialog pop-up opens.
    Find Java
  4. Select "Java" tab. Inside the Java tab, click on "View" button. It opens the "Java Runtime Environment Settings"
    Find Java Tab
  5. Change amount of heap. In the "Runtime Parameters" column change the value, or if it is blank decide for the new value, of the Java memory.
    View Java Runtime Environment
  6. Modify the parameter. To modify the parameter, double click in the "Runtime Parameters" column and,
    Modify Runtime Parameter
    • type -Xmx512m that assigns 512MB memory for the Java.
    • type -Xmx1024m that assigns 1GB memory for the Java.
    • type -Xmx2048m that assigns 2GB memory for the Java.
    • type -Xmx3072m that assigns 3GB memory for the Java, and so on.
    • Please note, it begins with a minus sign and ends to an m.
    • Also note, there is no blank space between characters.
  7. Close the dialogue box. Click on "OK" button on the "Java Runtime Environment Settings" to close it.
  8. Close Java dialogue box. "Apply" button in the "Java Control Panel" has been enabled now. You should click on "Apply" to finalise the new Java memory. Then click on the "OK" button.
  9. Close the Windows 7 Control Panel.

Tips

  • No restart of the computer is necessary after modifying the Java memory.
  • This is a temporary memory which is available for Java applications when you are running them. It does not "steal" or permanently deduct from the memory of computer. It is only a guarantee for Java Virtual Machine.
  • The value you select depends on how much memory sticks you have in computer and how consuming is the application you like to run.
  • If Java cannot find enough memory it dispatches an "exception" message to the Windows as, "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space."
  • This method with some modification also can be used for Windows Xp
  • This method also can be used for Windows 8 and Windows 10.

Related How To's