Get current size of heap in bytes : Runtime « Development Class « Java
- Java
- Development Class
- Runtime
Get current size of heap in bytes
public class Main {
public static void main(String[] argv) {
long heapSize = Runtime.getRuntime().totalMemory();
System.out.println(heapSize);
}
}
Related examples in the same category