CLOUD PERFORMANCE TUNING
ASSIGNMENT- 9
Q1.) Write a program in java to get the maximum amount of memory (sandbox
limit) for a Java application
INPUT
public class MaxMemory{
public static void main(String a[])
{
Runtime runtime = Runtime.getRuntime();
System.out.println("max memory: " + runtime.maxMemory() / 1024);
}
}
OUTPUT
Q2.) Write a program in java to check the allocated memory by JVM
INPUT
public class MaxMemory2{
public static void main(String a[])
{
Runtime runtime = Runtime.getRuntime();
System.out.println("allocated memory: " + runtime.totalMemory() /
1024);
}
}
OUTPUT
ASSIGNMENT- 9
Q1.) Write a program in java to get the maximum amount of memory (sandbox
limit) for a Java application
INPUT
public class MaxMemory{
public static void main(String a[])
{
Runtime runtime = Runtime.getRuntime();
System.out.println("max memory: " + runtime.maxMemory() / 1024);
}
}
OUTPUT
Q2.) Write a program in java to check the allocated memory by JVM
INPUT
public class MaxMemory2{
public static void main(String a[])
{
Runtime runtime = Runtime.getRuntime();
System.out.println("allocated memory: " + runtime.totalMemory() /
1024);
}
}
OUTPUT