Hi All,
I have JVM OutOfMemory Error in my java program. What is this?
How can i resolve it?
Thanks,
I have JVM OutOfMemory Error in my java program. What is this?
How can i resolve it?
Thanks,
java -Xmx<HeapSize> -cp <ClassPath> <YourMainClass>
java -Xmx<HeapSize> -cp <ClassPath> <YourMainClass>
class Status
{
public static void main(String[] args)
{
Runtime rt = Runtime.getRuntime();
System.out.println(rt.totalMemory());
System.out.println(rt.maxMemory());
System.out.println(rt.freeMemory());
}
}
class Status
{
public static void main(String[] args)
{
Runtime rt = Runtime.getRuntime();
System.out.println(rt.totalMemory());
System.out.println(rt.maxMemory());
System.out.println(rt.freeMemory());
}
}
Comment