Mega Code Archive

 
Categories / Java / Development Class
 

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);   } }