Notes:java comile flag

    技术2026-05-09  3

    article original address:http://www.ibm.com/developerworks/java/library/j-5things11/index.html

    DisableExplicitGC flag

    Explicit garbage collection is a really bad idea -- sometimes on the order of locking youreself in a phone booth with a rabid pit bull.

    System.gc()forces the VM to do a full sweeper of the heap, even if one isn't necessary. Full sweeps are typically serveral orders of magnitude more.

    The +DisableExplicitGC flag automatically turns a System.gcc() call into a no-op, giving you the opportunity to run your code and see for yourself whether System.gc() has helped or harmed the overall execution of JVM.

    HeapDumpOnOutOfMemoryError

    The +HeapDumpOnOutOfMemoryError flag let VM catch a snapshot of heap right as the VM on its dying breath.

     

    最新回复(0)