Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Understanding Memory Management of JavaVM
 in 15 minutes

Understanding Memory Management of JavaVM
 in 15 minutes

Shinji Tanaka

April 07, 2014
Tweet

More Decks by Shinji Tanaka

Other Decks in Technology

Transcript

  1. Understanding Memory Management of JavaVM
 in 15 minutes @stanaka /

    id:stanaka JVM Operation Casual Talks at 2014/4/7
  2. Shinji TANAKA CTO at Hatena Co., Ltd. ࠷ۙͷ׆ಈ: Immutable Infrastructure

    @stanaka / id:stanaka We’re Hiring at both KYOTO and TOKYO!
  3. Memory Model in JavaVM Stack ← ελοΫྖҬ εϨου͝ͱʹ͋Δ Non Heap

    ← JavaVM಺෦Ͱ࢖͏ྖҬ ίʔυΩϟογϡ (JIT݁ՌͳͲ) Permanent Generation (Java8͔Β͸࡟আ) Heap ← ΞϓϦέʔγϣϯ͕࢖͏ྖҬ GCର৅
  4. Garbage Collection Algorithms Mark & Sweep Mark & Compaction Generational

    GC (JDK 1.2, 1998) Parallel GC Incremental GC (-Xincgc, Java8Ͱඇਪ঑) Concurrent Mark-Sweep GC, CMS (JDK 1.4.1 2002) Garbage-First GC, G1 GC (JDK 1.6u14 2009)
  5. GC Benchmark Parallel CMS G1 Total GC pauses 20,930ms 18,870ms

    62,000ms Max GC pause 721ms 64ms 50ms JIRA benchmark test for 30 minutes with -Xms256m -Xmx768m -XX:MaxPermSize=256m https://plumbr.eu/blog/g1-vs-cms-vs-parallel-gc Tuning͢ΔͱG1ͷ΄͏͕CPUෛՙ΋ ؚΊͯ΋ྑ͍ͱ͍͏݁Ռ΋͋Δ [JavaOne2013]
  6. Reference Memory Management in the Java HotSpot Virtual Machine ˑ

    http://www.oracle.com/technetwork/java/javase/memorymanagement-whitepaper-150215.pdf [Whitepaper2006] A Generational Mostly-concurrent Garbage Collector https://www.cs.purdue.edu/homes/hosking/ismm2000/papers/printezis.pdf [ISMM2000] The Garbage-First Garbage Collector http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.63.6386&rep=rep1&type=pdf [ISMM2004] ˑ http://www.oracle.com/technetwork/server-storage/ts-5419-159484.pdf [JavaOne 2008] Garbage-First Garbage Collector: Migration to, Expectations and Advanced Tuning. ˑ http://www.slideshare.net/MonicaBeckwith/garbage-first-garbage-collector-g1-gc-migration-to- expectations-and-advanced-tuning [JavaOne2013] Java Virtual Machine Technology http://docs.oracle.com/javase/8/docs/technotes/guides/vm/ International Symposium on Memory Management (ISMM) http://www.sigplan.org/conferences/ismm/main