How To Increase Heap Size In Java
Hello, I am searching for the solution from which I can able to get the solution for increasing the heap size in java for solving the error of java.lang.OutOfMemoryError. If anyone is having idea regarding it, then it will be helpful to me to solve the problem of that error. I have check it from many sources, but I am not able to get the solution for this problem. So, please help me to solve this problem.
Re: How To Increase Heap Size In Java
Hello, you have told that you are getting the error of java.lang.OutOfMemoryError then it can possible that you are having the problem of the leak. It can be possible that you are having problem of the memory leak. You can solve this problem by making use of the tools such as YourKit Java Profiler that help you to identify such leaks. So, just make use of the such tools and solve your problem instead of increasing the size of the heap. So, just use such tool and solve your problem.
Re: How To Increase Heap Size In Java
Hello, if you want to increase heap size in java then you will able to get the solution for your problem by the use of the following runtime parameters:
Quote:
java -Xms<initial heap size> -Xmx<maximum heap size>
I am not sure, but if you make use of the default value then it is as below:
Quote:
java -Xms32m -Xmx128m
If you want to set it, then you can simply use the Java Control Panel. Or it can be possible that you can simply make use of the command prompt you can simply run this command.
Re: How To Increase Heap Size In Java
Hello, it is necessary to make use of the code below for checking the heap size of the java virtual machine:
Code:
public class HeapSize
{
public static void main(String[]args)
{
long Size = Runtime.getRuntime().totalMemory();
System.out.println("Heap Size = " + Size);
}
}
And then you can simply make use of the following options for changing it:
- Xms<size> ---- For initial Java heap size
- Xmx<size> ---- For maximum Java heap size
- Xss<size> ---- For java thread stack size
Re: How To Increase Heap Size In Java
Hello, if you want to increase the web server heap size then you must need to make use of the steps below:
- First you need to login with the Administration Server.
- Here you will get the JVM Options in java tab.
- Now just edit the Xmx256m option.
- And set the heap size upto the higher value.
- Now just save the setting
Re: How To Increase Heap Size In Java
Hello, I am using JDK 1.6 on my computer. Now, if I want to increase the heap size then I will follow the steps below:
- Click on the start button.
- Now click on Control Panel for opening the control panel.
- Now it is necessary to opent the Java Plug-in icon and then need to open the Other Options.
- Now click on the view by selecting the java tab.
- Now double click on the Java Runtime Parameters and set the maxmum size.
- And then click on OK.
- Now you need to exit from the all of the web browsers.
- Problem solved.