힙사이즈 조절


$cp /Applications/IntelliJ IDEA 13.app/bin/idea.vmoptions ~/Library/Preferences/IntelliJIDEA13/idea.vmoptions

$vi ~/Library/Preferences/IntelliJIdea13/idea.vmoptions


-Xms2048m

-Xmx2048m

-XX:MaxPermSize=512m

-XX:ReservedCodeCacheSize=128m

-XX:+UseCompressedOops


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

링크 : 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