링크 : http://viralpatel.net/blogs/getting-jvm-heap-size-used-memory-total-memory-using-java-runtime/

/**

* Class: TestMemory

* @author: Viral Patel

* @description: Prints JVM memory utilization statistics

*/

public class TestMemory {

     

    public static void main(String [] args) {

         

        int mb = 1024*1024;

         

        //Getting the runtime reference from system

        Runtime runtime = Runtime.getRuntime();

         

        System.out.println("##### Heap utilization statistics [MB] #####");

         

        //Print used memory

        System.out.println("Used Memory:"

            + (runtime.totalMemory() - runtime.freeMemory()) / mb);

 

        //Print free memory

        System.out.println("Free Memory:"

            + runtime.freeMemory() / mb);

         

        //Print total available memory

        System.out.println("Total Memory:" + runtime.totalMemory() / mb);

 

        //Print Maximum available memory

        System.out.println("Max Memory:" + runtime.maxMemory() / mb);

    }

}


저작자 표시 비영리 변경 금지
신고
posted by 뚱2

링크 : http://firejune.com/1275/자바스크립트+메모리+릭+디텍터?stag=메모리+릭 

링크 : http://rhio.tistory.com/177



JSLeaksDetector.msi


저작자 표시 비영리 변경 금지
신고
posted by 뚱2