SlideShare uma empresa Scribd logo
1 de 59
Do Your GC Logs
  Speak To You
Using Measurements to Tune Java
      Memory Management




   Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




                                  About Me
         •   Consultant (www.kodewerk.com)

              •    performance tuning and training seminar

         •   Co-author www.javaperformancetuning.com

         •   Member of Java Champion program

         •   Other stuff... (google is you care to)


                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




         •   Most recently founded a tooling company

         •                                  jClarity
         •   We are well on the road to delivering the
             next generation of advanced performance
             tooling




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




                               Disclaimer

                The resemblance of any
                opinion, recommendation or
                comment made during this
                presentation to performance
                tuning advice is merely
                coincidental.

                            Copyright 2012 Kodewerk Ltd. All rights reserved
Why should I monitor GC?




  Copyright 2012 Kodewerk Ltd. All rights reserved
GC logs contain the
information you need to
make informed choices
about how to tune Java
Memory managemet



    Copyright 2012 Kodewerk Ltd. All rights reserved
What is the performance impact of
   logging GC in production?




      Copyright 2012 Kodewerk Ltd. All rights reserved
How do I get a GC log?




 Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services



                      -verbose:gc (not recommended)

                      -Xloggc:gc.log (recommended)

                      -XX:+PrintGCDetails

                      -XX:+PrintTenuringDistribution

                      -XX:+PrintHeapAtGC

                      -XX:+UseGCLogFileRotation (7.0 feature)

                            -XX:NumberOfGCLogFiles=10

                            -XX:GCLogFileSize=1g

                             Copyright 2012 Kodewerk Ltd. All rights reserved
What does the output look like?




    Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]
34549.200: [Full GC [PSYoungGen: 8202K->0K(303360K)]
[ParOldGen: 3946352K->3836581K(4015744K)] 3954555K-
>3836581K(4319104K) [PSPermGen: 225220K->225178K(226048K)],
2.2787100 secs]
34551.642: [GC
Desired survivor size 34078720 bytes, new threshold 1 (max 15)
[PSYoungGen: 295104K->7480K(307584K)] 4131685K-
>3844062K(4323328K), 0.0091790 secs]
34551.750: [GC
Desired survivor size 32702464 bytes, new threshold 1 (max 15)
[PSYoungGen: 293240K->4081K(280896K)] 4129822K-
>3847294K(4296640K), 0.0086640 secs]
34551.862: [GC
Desired survivor size 31260672 bytes, new threshold 1 (max 15)

             Copyright 2012 Kodewerk Ltd. All rights reserved
What is this gobbledygook trying
            to tell me?




     Copyright 2012 Kodewerk Ltd. All rights reserved
Java Heap



Java heap is reserved as a contiguous
block from C heap

 (-mx<size>)




        Copyright 2012 Kodewerk Ltd. All rights reserved
young                                 old


Sub-divide to create generational spaces

 segregate data by age

Young size is defined by

 -XX:NewRatio=n, default is 8

 -mn=<size>

Old is what remains

        Copyright 2012 Kodewerk Ltd. All rights reserved
reserved




                                                            reserved
eden S0 S1                           tenured
 n    1 1

Allocate 4 memory pools from reserved

  initial sizes calculated using -ms<size>

In young we have

  eden survivor 0 and survivor 1

  -XX:SurvivorRatio=n

Tenured is allocated from old
         Copyright 2012 Kodewerk Ltd. All rights reserved
reserved




                                                            reserved
eden S0 S1                           tenured



Eden is consumed by application threads

  otherwise known as mutator threads

Allocation failure triggers a garbage
collections to recover deferenced memory

  safe pointing assures mutually exclusive
  access (-XX:+PrintSafepointStatistics)

         Copyright 2012 Kodewerk Ltd. All rights reserved
reserved




                                                           reserved
eden S0 S1                          tenured



Two types of collections

  scavange

    allocation failure in a memory pool

    reach an occupancy threshold

Full collects all memory pools in a single
event

        Copyright 2012 Kodewerk Ltd. All rights reserved
reserved




                                                            reserved
eden S0 S1                           tenured


Mark and Sweep

  pick a memory pool and scan for it’s
  GC roots

  trace and mark all objects reachable
  from those GC roots

  sweep cleans out dead objects

    well, sort of
         Copyright 2012 Kodewerk Ltd. All rights reserved
reserved




                                                           reserved
eden S0 S1                          tenured


Eden is evacuated to the inactive survivor
space

Active survivor space is evacuated to

  inactive survivor space

  tenured (-XX:MaxTenuringDistribuion=n)

  inactive survivor space made active

All evacuated spaces are empty after a GC
        Copyright 2012 Kodewerk Ltd. All rights reserved
reserved




                                                            reserved
eden S0 S1                           tenured



Before GC starts, calculate if tenured
needs to be collected

  in place collection (expensive)

  free list management

  fragmentation

    compaction

         Copyright 2012 Kodewerk Ltd. All rights reserved
reserved




                                                                    reserved
    eden S0 S1                               tenured

uint i = 0;
if (UseSerialGC)                                       i++;
if (UseConcMarkSweepGC || UseParNewGC) i++;
if (UseParallelGC || UseParallelOldGC)                 i++;
if (UseG1GC)                                           i++;
if (i > 1) {
    jio_fprintf(defaultStream::error_stream(),
               "Conflicting collector combinations in option list; "
               "please refer to the release notes for the
combinations "
               "allowedn");
    status = false;
}

                 Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]
34549.200: [Full GC [PSYoungGen: 8202K->0K(303360K)]
[ParOldGen: 3946352K->3836581K(4015744K)] 3954555K-
>3836581K(4319104K) [PSPermGen: 225220K->225178K(226048K)],
2.2787100 secs]
34551.642: [GC
Desired survivor size 34078720 bytes, new threshold 1 (max 15)
[PSYoungGen: 295104K->7480K(307584K)] 4131685K-
>3844062K(4323328K), 0.0091790 secs]
34551.750: [GC
Desired survivor size 32702464 bytes, new threshold 1 (max 15)
[PSYoungGen: 293240K->4081K(280896K)] 4129822K-
>3847294K(4296640K), 0.0086640 secs]
34551.862: [GC
Desired survivor size 31260672 bytes, new threshold 1 (max 15)

             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




                 reserved




                                                                   reserved
eden S0 S1                                   old

 Collection called for @                  34404.738      seconds
 after VM startup

 Pause time =               0.0088250   seconds

 Scavange algorithm:                PSYoungGen

   UseParallelOldGC collects both tenured and young gen
             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




Configured size:                4156736K               reserved


 Outer block provides a global picture

 Adaptive sizing calculates size based on
 recent activity

   grow or shrink heap in an attempt to
   improve GC effecency
             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




                                                       reserved


 occupancy before = 3917704K




             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




                                                       reserved


 occupancy before = 3917704K

 occupancy after = 3775494K




             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




                                                       reserved


 occupancy before = 3917704K

 occupancy after = 3775494K

 heap recovered = 3917704K - 3775494K

                          = 14220K

             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




                 reserved




                                                                reserved
eden S0 S1                               tenured

 For PSYoungGen

   configured size =              206720K


   occupancy before =                148069K


      survivor occupancy after =                       5859K


   recovered = 14220K
             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




                 reserved




                                                                reserved
eden S0 S1                               tenured


 old = total - young

   occupancy before =                3917704K - 148069K = 3769635K


   occupancy after =               3775494K - 5859K = 3769635K


   promoted = 14220 -14220 = 0K
             Copyright 2012 Kodewerk Ltd. All rights reserved
34404.738: [GC
Desired survivor size 38535168 bytes, new threshold 3 (max 15)
[PSYoungGen: 148069K->5859K (206720K)] 3917704K ->
3775494K(4156736K), 0.0088250 secs]




                 reserved




                                                                reserved
eden S0 S1                               tenured

 For survivor spaces

   survivor size =           38535168


 -XX:MaxTenuringThreshold=n, default 4/15

   new threshold (1..n), < n premature
   promotion
             Copyright 2012 Kodewerk Ltd. All rights reserved
Full GC Record
34401.996: [Full GC [PSYoungGen: 14634K->0K(160384K)]
[ParOldGen: 3971552K->3769634K(3950016K)] 3986187K-
>3769634K(4110400K) [PSPermGen: 225242K->225175K(226048K)],
2.4645280 secs] [Times: user=26.03 sys=0.01, real=2.47 secs]


  Full GC collections both young and tenured spaces
  Report on
     Young Gen: completely empties, resize
     Old Gen: occupancy and resize
     Total heap: occupancy and resize
     Perm Gen: occupancy and resize
     Timing: Time GC called for and pause time

               Copyright 2012 Kodewerk Ltd. All rights reserved
163.028: [GC 163.028: [DefNew
Desired survivor size 115671040 bytes, new threshold 15 (max 15)
- age   1:      736 bytes,           736 total
- age   2:      112 bytes,          848 total
- age   4:       40 bytes,            888 total
- age   6:      232 bytes,          1120 total
- age   7:       32 bytes,         1152 total
- age 11:        96 bytes,          1248 total
: 226048K->1K(451968K), 0.0018054 secs] 669064K-
>443016K(1129856K), 0.0018580 secs]


  ParNew

    breakdown of survivor occupancy by age




               Copyright 2012 Kodewerk Ltd. All rights reserved
0.333: [GC [1 CMS-initial-mark: 0K(2015232K)] 4907K(2097088K),
0.0173905 secs]
0.351: [CMS-concurrent-mark-start]
0.979: [CMS-concurrent-mark: 0.619/0.628 secs]
0.979: [CMS-concurrent-preclean-start]
1.029: [CMS-concurrent-preclean: 0.050/0.050 secs]
1.029: [CMS-concurrent-abortable-preclean-start]
9.341: [CMS-concurrent-abortable-preclean: 2.271/8.312 secs]
9.343: [GC[YG occupancy: 40921 K (81856 K)]9.343: [Rescan
(parallel) , 0.0240270 secs]9.367: [weak refs processing, 0.0000358
secs] [1 CMS-remark: 0K(2015232K)] 40921K(2097088K), 0.0244228
secs]
9.368: [CMS-concurrent-sweep-start]
9.368: [CMS-concurrent-sweep: 0.000/0.000 secs]
9.368: [CMS-concurrent-reset-start]
9.816: [CMS-concurrent-reset: 0.447/0.448 secs]



                  Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




               Use the GC logs to improve
               performance of a web app

                        run 5tx/sec

               Goals

                        reduce response time

                        improve transactional throughput

                        reduce hardware consumption

                        eliminate stalls
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm




                      Run 1 (defauts)
Java Performance Services




2012-09-26 21:57:58.636::WARN: Error for /j1/bench
java.lang.OutOfMemoryError: Java heap space




            Most likely default heap size is too
            small



                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm




                     Heap Occupancy
Java Performance Services




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm




                               Run 2 (1g)
Java Performance Services




                                                                 25 < CPU < 70

                                                                 ~60%



                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




        GC pause is 15.56% of run time

              should be less than 5%

        ParNew is working harder than it
        should

              GC frequency too high

                     promoting too many object
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




             Premature promotion @ 83.3%

                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




             Increase size of tenured spaces

                   increase size of young gen

                            -XX:NewSize=512m

                             young = 512m, tenured = 512m

                            SurvivorRatio=1

                             all 3 spaces are ~170m


                             Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
                                        Run 2
   tm
Java Performance Services




                                        Run 3




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm




                                Run 3 CPU
Java Performance Services




                                                                  20 < CPU < 50

                                                                  ~40%

                                                                      -20%




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




   Eliminated premature promotions




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




    ParNew is working less frequently @ 1.42/
    sec

          because of the bigger space

          object now die in young gen

    GC pause down to 3.13%

    Can we improve the memory footprint?
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




   We are using much less memory

         but only because we gave it more
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




   Looks likeSurvivor could be about 60m

         will induce some premature promotion
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




  Suggest tenuring threshold should ~5

        eliminate some copy costs
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm




                                        Run 4
Java Performance Services




             Configure eden to 180m

                   maintain GC frequency

             S0/S1 to 60m each

             Eden + S0 + S1 <= Tenured

                   180+60+60=300+300=600m

                   survivor ratio = 3

             Tenured should be 5 (maybe 4)
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
                                        Run 2
   tm
Java Performance Services




                                        Run 3


                                       Run 4

                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm




                               Run 4 CPU
Java Performance Services




                                                                  20 < CPU < 50

                                                                  ~40%

                                                                      no change




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




    ParNew is working about the same (was
    1.42 runs/sec)

    GC puase remains about the same (was
    3.13%)

    Much improved memory footprint

          600m vs. 1024m
                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




                                                   GC adapts to a
                                                   configuration we
                                                   calculated




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm
Java Performance Services




Could the JVM have
done this on it’s own?



                            Copyright 2012 Kodewerk Ltd. All rights reserved
Kodewerk
   tm




                                     Yeabut....
Java Performance Services




             Set max heap 1G, new ratio and
             survivor ratio to 1

                   JVM will produce identical results

                            but only after a warmup

                            and only under a set of ideal
                            conditions

                             results can vary run to run

                             Copyright 2012 Kodewerk Ltd. All rights reserved
Questions



Copyright 2012 Kodewerk Ltd. All rights reserved

Mais conteúdo relacionado

Mais procurados

Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
Kyle Hailey
 
Effective testing for spark programs Strata NY 2015
Effective testing for spark programs   Strata NY 2015Effective testing for spark programs   Strata NY 2015
Effective testing for spark programs Strata NY 2015
Holden Karau
 
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
DataWorks Summit
 

Mais procurados (20)

Openstack presentation
Openstack presentationOpenstack presentation
Openstack presentation
 
Fight with Metaspace OOM
Fight with Metaspace OOMFight with Metaspace OOM
Fight with Metaspace OOM
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展
 
GoodFit: Multi-Resource Packing of Tasks with Dependencies
GoodFit: Multi-Resource Packing of Tasks with DependenciesGoodFit: Multi-Resource Packing of Tasks with Dependencies
GoodFit: Multi-Resource Packing of Tasks with Dependencies
 
Static Analysis and Code Optimizations in Glasgow Haskell Compiler
Static Analysis and Code Optimizations in Glasgow Haskell CompilerStatic Analysis and Code Optimizations in Glasgow Haskell Compiler
Static Analysis and Code Optimizations in Glasgow Haskell Compiler
 
Distributed caching and computing v3.7
Distributed caching and computing v3.7Distributed caching and computing v3.7
Distributed caching and computing v3.7
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
 
Monitoring with Ganglia
Monitoring with GangliaMonitoring with Ganglia
Monitoring with Ganglia
 
Thanos - Prometheus on Scale
Thanos - Prometheus on ScaleThanos - Prometheus on Scale
Thanos - Prometheus on Scale
 
Processing Big Data in Real-Time - Yanai Franchi, Tikal
Processing Big Data in Real-Time - Yanai Franchi, TikalProcessing Big Data in Real-Time - Yanai Franchi, Tikal
Processing Big Data in Real-Time - Yanai Franchi, Tikal
 
GPUs in Big Data - StampedeCon 2014
GPUs in Big Data - StampedeCon 2014GPUs in Big Data - StampedeCon 2014
GPUs in Big Data - StampedeCon 2014
 
Large volume data analysis on the Typesafe Reactive Platform
Large volume data analysis on the Typesafe Reactive PlatformLarge volume data analysis on the Typesafe Reactive Platform
Large volume data analysis on the Typesafe Reactive Platform
 
Effective testing for spark programs Strata NY 2015
Effective testing for spark programs   Strata NY 2015Effective testing for spark programs   Strata NY 2015
Effective testing for spark programs Strata NY 2015
 
Metrics with Ganglia
Metrics with GangliaMetrics with Ganglia
Metrics with Ganglia
 
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and TelegrafObtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
 
Jvm heap
Jvm heapJvm heap
Jvm heap
 
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
 
Dive into Catalyst
Dive into CatalystDive into Catalyst
Dive into Catalyst
 
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
 
NoSQL @ CodeMash 2010
NoSQL @ CodeMash 2010NoSQL @ CodeMash 2010
NoSQL @ CodeMash 2010
 

Destaque (6)

Gclogs jdd
Gclogs jddGclogs jdd
Gclogs jdd
 
Gclogs
GclogsGclogs
Gclogs
 
SQLBits VI - Improving database performance by removing the database
SQLBits VI - Improving database performance by removing the databaseSQLBits VI - Improving database performance by removing the database
SQLBits VI - Improving database performance by removing the database
 
Performance Tuning: You’re doing it wrong! by Kirk Pepperdine
Performance Tuning: You’re doing it wrong! by Kirk PepperdinePerformance Tuning: You’re doing it wrong! by Kirk Pepperdine
Performance Tuning: You’re doing it wrong! by Kirk Pepperdine
 
El Proyecto TecnolóGico
El  Proyecto  TecnolóGicoEl  Proyecto  TecnolóGico
El Proyecto TecnolóGico
 
Garbage Collection - The Useful Parts
Garbage Collection - The Useful PartsGarbage Collection - The Useful Parts
Garbage Collection - The Useful Parts
 

Semelhante a Gclogs j1

JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
Kai Koenig
 

Semelhante a Gclogs j1 (20)

JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
 
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...
Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...
Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...
 
Java and Serverless - A Match Made In Heaven, Part 2
Java and Serverless - A Match Made In Heaven, Part 2Java and Serverless - A Match Made In Heaven, Part 2
Java and Serverless - A Match Made In Heaven, Part 2
 
Tuning the g1gc
Tuning the g1gcTuning the g1gc
Tuning the g1gc
 
Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9
 
Le guide de dépannage de la jvm
Le guide de dépannage de la jvmLe guide de dépannage de la jvm
Le guide de dépannage de la jvm
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
 
A G1GC Saga-KCJUG.pptx
A G1GC Saga-KCJUG.pptxA G1GC Saga-KCJUG.pptx
A G1GC Saga-KCJUG.pptx
 
GC Tuning & Troubleshooting Crash Course
GC Tuning & Troubleshooting Crash CourseGC Tuning & Troubleshooting Crash Course
GC Tuning & Troubleshooting Crash Course
 
Tools for Metaspace
Tools for MetaspaceTools for Metaspace
Tools for Metaspace
 
Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection Hero
 
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBaseHBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
 
“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core
 
Pitch v2.2
Pitch v2.2Pitch v2.2
Pitch v2.2
 
Apache Pinot Meetup Sept02, 2020
Apache Pinot Meetup Sept02, 2020Apache Pinot Meetup Sept02, 2020
Apache Pinot Meetup Sept02, 2020
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 
Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG Presentation
 
G1: To Infinity and Beyond
G1: To Infinity and BeyondG1: To Infinity and Beyond
G1: To Infinity and Beyond
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Gclogs j1

  • 1. Do Your GC Logs Speak To You Using Measurements to Tune Java Memory Management Copyright 2012 Kodewerk Ltd. All rights reserved
  • 2. Kodewerk tm Java Performance Services About Me • Consultant (www.kodewerk.com) • performance tuning and training seminar • Co-author www.javaperformancetuning.com • Member of Java Champion program • Other stuff... (google is you care to) Copyright 2012 Kodewerk Ltd. All rights reserved
  • 3. Kodewerk tm Java Performance Services • Most recently founded a tooling company • jClarity • We are well on the road to delivering the next generation of advanced performance tooling Copyright 2012 Kodewerk Ltd. All rights reserved
  • 4. Kodewerk tm Java Performance Services Disclaimer The resemblance of any opinion, recommendation or comment made during this presentation to performance tuning advice is merely coincidental. Copyright 2012 Kodewerk Ltd. All rights reserved
  • 5. Why should I monitor GC? Copyright 2012 Kodewerk Ltd. All rights reserved
  • 6. GC logs contain the information you need to make informed choices about how to tune Java Memory managemet Copyright 2012 Kodewerk Ltd. All rights reserved
  • 7. What is the performance impact of logging GC in production? Copyright 2012 Kodewerk Ltd. All rights reserved
  • 8. How do I get a GC log? Copyright 2012 Kodewerk Ltd. All rights reserved
  • 9. Kodewerk tm Java Performance Services -verbose:gc (not recommended) -Xloggc:gc.log (recommended) -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation (7.0 feature) -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=1g Copyright 2012 Kodewerk Ltd. All rights reserved
  • 10. What does the output look like? Copyright 2012 Kodewerk Ltd. All rights reserved
  • 11. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] 34549.200: [Full GC [PSYoungGen: 8202K->0K(303360K)] [ParOldGen: 3946352K->3836581K(4015744K)] 3954555K- >3836581K(4319104K) [PSPermGen: 225220K->225178K(226048K)], 2.2787100 secs] 34551.642: [GC Desired survivor size 34078720 bytes, new threshold 1 (max 15) [PSYoungGen: 295104K->7480K(307584K)] 4131685K- >3844062K(4323328K), 0.0091790 secs] 34551.750: [GC Desired survivor size 32702464 bytes, new threshold 1 (max 15) [PSYoungGen: 293240K->4081K(280896K)] 4129822K- >3847294K(4296640K), 0.0086640 secs] 34551.862: [GC Desired survivor size 31260672 bytes, new threshold 1 (max 15) Copyright 2012 Kodewerk Ltd. All rights reserved
  • 12. What is this gobbledygook trying to tell me? Copyright 2012 Kodewerk Ltd. All rights reserved
  • 13. Java Heap Java heap is reserved as a contiguous block from C heap (-mx<size>) Copyright 2012 Kodewerk Ltd. All rights reserved
  • 14. young old Sub-divide to create generational spaces segregate data by age Young size is defined by -XX:NewRatio=n, default is 8 -mn=<size> Old is what remains Copyright 2012 Kodewerk Ltd. All rights reserved
  • 15. reserved reserved eden S0 S1 tenured n 1 1 Allocate 4 memory pools from reserved initial sizes calculated using -ms<size> In young we have eden survivor 0 and survivor 1 -XX:SurvivorRatio=n Tenured is allocated from old Copyright 2012 Kodewerk Ltd. All rights reserved
  • 16. reserved reserved eden S0 S1 tenured Eden is consumed by application threads otherwise known as mutator threads Allocation failure triggers a garbage collections to recover deferenced memory safe pointing assures mutually exclusive access (-XX:+PrintSafepointStatistics) Copyright 2012 Kodewerk Ltd. All rights reserved
  • 17. reserved reserved eden S0 S1 tenured Two types of collections scavange allocation failure in a memory pool reach an occupancy threshold Full collects all memory pools in a single event Copyright 2012 Kodewerk Ltd. All rights reserved
  • 18. reserved reserved eden S0 S1 tenured Mark and Sweep pick a memory pool and scan for it’s GC roots trace and mark all objects reachable from those GC roots sweep cleans out dead objects well, sort of Copyright 2012 Kodewerk Ltd. All rights reserved
  • 19. reserved reserved eden S0 S1 tenured Eden is evacuated to the inactive survivor space Active survivor space is evacuated to inactive survivor space tenured (-XX:MaxTenuringDistribuion=n) inactive survivor space made active All evacuated spaces are empty after a GC Copyright 2012 Kodewerk Ltd. All rights reserved
  • 20. reserved reserved eden S0 S1 tenured Before GC starts, calculate if tenured needs to be collected in place collection (expensive) free list management fragmentation compaction Copyright 2012 Kodewerk Ltd. All rights reserved
  • 21. reserved reserved eden S0 S1 tenured uint i = 0; if (UseSerialGC) i++; if (UseConcMarkSweepGC || UseParNewGC) i++; if (UseParallelGC || UseParallelOldGC) i++; if (UseG1GC) i++; if (i > 1) { jio_fprintf(defaultStream::error_stream(), "Conflicting collector combinations in option list; " "please refer to the release notes for the combinations " "allowedn"); status = false; } Copyright 2012 Kodewerk Ltd. All rights reserved
  • 22. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] 34549.200: [Full GC [PSYoungGen: 8202K->0K(303360K)] [ParOldGen: 3946352K->3836581K(4015744K)] 3954555K- >3836581K(4319104K) [PSPermGen: 225220K->225178K(226048K)], 2.2787100 secs] 34551.642: [GC Desired survivor size 34078720 bytes, new threshold 1 (max 15) [PSYoungGen: 295104K->7480K(307584K)] 4131685K- >3844062K(4323328K), 0.0091790 secs] 34551.750: [GC Desired survivor size 32702464 bytes, new threshold 1 (max 15) [PSYoungGen: 293240K->4081K(280896K)] 4129822K- >3847294K(4296640K), 0.0086640 secs] 34551.862: [GC Desired survivor size 31260672 bytes, new threshold 1 (max 15) Copyright 2012 Kodewerk Ltd. All rights reserved
  • 23. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] Copyright 2012 Kodewerk Ltd. All rights reserved
  • 24. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] reserved reserved eden S0 S1 old Collection called for @ 34404.738 seconds after VM startup Pause time = 0.0088250 seconds Scavange algorithm: PSYoungGen UseParallelOldGC collects both tenured and young gen Copyright 2012 Kodewerk Ltd. All rights reserved
  • 25. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] Configured size: 4156736K reserved Outer block provides a global picture Adaptive sizing calculates size based on recent activity grow or shrink heap in an attempt to improve GC effecency Copyright 2012 Kodewerk Ltd. All rights reserved
  • 26. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] reserved occupancy before = 3917704K Copyright 2012 Kodewerk Ltd. All rights reserved
  • 27. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] reserved occupancy before = 3917704K occupancy after = 3775494K Copyright 2012 Kodewerk Ltd. All rights reserved
  • 28. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] reserved occupancy before = 3917704K occupancy after = 3775494K heap recovered = 3917704K - 3775494K = 14220K Copyright 2012 Kodewerk Ltd. All rights reserved
  • 29. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] reserved reserved eden S0 S1 tenured For PSYoungGen configured size = 206720K occupancy before = 148069K survivor occupancy after = 5859K recovered = 14220K Copyright 2012 Kodewerk Ltd. All rights reserved
  • 30. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] reserved reserved eden S0 S1 tenured old = total - young occupancy before = 3917704K - 148069K = 3769635K occupancy after = 3775494K - 5859K = 3769635K promoted = 14220 -14220 = 0K Copyright 2012 Kodewerk Ltd. All rights reserved
  • 31. 34404.738: [GC Desired survivor size 38535168 bytes, new threshold 3 (max 15) [PSYoungGen: 148069K->5859K (206720K)] 3917704K -> 3775494K(4156736K), 0.0088250 secs] reserved reserved eden S0 S1 tenured For survivor spaces survivor size = 38535168 -XX:MaxTenuringThreshold=n, default 4/15 new threshold (1..n), < n premature promotion Copyright 2012 Kodewerk Ltd. All rights reserved
  • 32. Full GC Record 34401.996: [Full GC [PSYoungGen: 14634K->0K(160384K)] [ParOldGen: 3971552K->3769634K(3950016K)] 3986187K- >3769634K(4110400K) [PSPermGen: 225242K->225175K(226048K)], 2.4645280 secs] [Times: user=26.03 sys=0.01, real=2.47 secs] Full GC collections both young and tenured spaces Report on Young Gen: completely empties, resize Old Gen: occupancy and resize Total heap: occupancy and resize Perm Gen: occupancy and resize Timing: Time GC called for and pause time Copyright 2012 Kodewerk Ltd. All rights reserved
  • 33. 163.028: [GC 163.028: [DefNew Desired survivor size 115671040 bytes, new threshold 15 (max 15) - age 1: 736 bytes, 736 total - age 2: 112 bytes, 848 total - age 4: 40 bytes, 888 total - age 6: 232 bytes, 1120 total - age 7: 32 bytes, 1152 total - age 11: 96 bytes, 1248 total : 226048K->1K(451968K), 0.0018054 secs] 669064K- >443016K(1129856K), 0.0018580 secs] ParNew breakdown of survivor occupancy by age Copyright 2012 Kodewerk Ltd. All rights reserved
  • 34. 0.333: [GC [1 CMS-initial-mark: 0K(2015232K)] 4907K(2097088K), 0.0173905 secs] 0.351: [CMS-concurrent-mark-start] 0.979: [CMS-concurrent-mark: 0.619/0.628 secs] 0.979: [CMS-concurrent-preclean-start] 1.029: [CMS-concurrent-preclean: 0.050/0.050 secs] 1.029: [CMS-concurrent-abortable-preclean-start] 9.341: [CMS-concurrent-abortable-preclean: 2.271/8.312 secs] 9.343: [GC[YG occupancy: 40921 K (81856 K)]9.343: [Rescan (parallel) , 0.0240270 secs]9.367: [weak refs processing, 0.0000358 secs] [1 CMS-remark: 0K(2015232K)] 40921K(2097088K), 0.0244228 secs] 9.368: [CMS-concurrent-sweep-start] 9.368: [CMS-concurrent-sweep: 0.000/0.000 secs] 9.368: [CMS-concurrent-reset-start] 9.816: [CMS-concurrent-reset: 0.447/0.448 secs] Copyright 2012 Kodewerk Ltd. All rights reserved
  • 35. Kodewerk tm Java Performance Services Use the GC logs to improve performance of a web app run 5tx/sec Goals reduce response time improve transactional throughput reduce hardware consumption eliminate stalls Copyright 2012 Kodewerk Ltd. All rights reserved
  • 36. Kodewerk tm Run 1 (defauts) Java Performance Services 2012-09-26 21:57:58.636::WARN: Error for /j1/bench java.lang.OutOfMemoryError: Java heap space Most likely default heap size is too small Copyright 2012 Kodewerk Ltd. All rights reserved
  • 37. Kodewerk tm Heap Occupancy Java Performance Services Copyright 2012 Kodewerk Ltd. All rights reserved
  • 38. Kodewerk tm Java Performance Services Copyright 2012 Kodewerk Ltd. All rights reserved
  • 39. Kodewerk tm Run 2 (1g) Java Performance Services 25 < CPU < 70 ~60% Copyright 2012 Kodewerk Ltd. All rights reserved
  • 40. Kodewerk tm Java Performance Services GC pause is 15.56% of run time should be less than 5% ParNew is working harder than it should GC frequency too high promoting too many object Copyright 2012 Kodewerk Ltd. All rights reserved
  • 41. Kodewerk tm Java Performance Services Premature promotion @ 83.3% Copyright 2012 Kodewerk Ltd. All rights reserved
  • 42. Kodewerk tm Java Performance Services Copyright 2012 Kodewerk Ltd. All rights reserved
  • 43. Kodewerk tm Java Performance Services Increase size of tenured spaces increase size of young gen -XX:NewSize=512m young = 512m, tenured = 512m SurvivorRatio=1 all 3 spaces are ~170m Copyright 2012 Kodewerk Ltd. All rights reserved
  • 44. Kodewerk Run 2 tm Java Performance Services Run 3 Copyright 2012 Kodewerk Ltd. All rights reserved
  • 45. Kodewerk tm Run 3 CPU Java Performance Services 20 < CPU < 50 ~40% -20% Copyright 2012 Kodewerk Ltd. All rights reserved
  • 46. Kodewerk tm Java Performance Services Eliminated premature promotions Copyright 2012 Kodewerk Ltd. All rights reserved
  • 47. Kodewerk tm Java Performance Services ParNew is working less frequently @ 1.42/ sec because of the bigger space object now die in young gen GC pause down to 3.13% Can we improve the memory footprint? Copyright 2012 Kodewerk Ltd. All rights reserved
  • 48. Kodewerk tm Java Performance Services We are using much less memory but only because we gave it more Copyright 2012 Kodewerk Ltd. All rights reserved
  • 49. Kodewerk tm Java Performance Services Looks likeSurvivor could be about 60m will induce some premature promotion Copyright 2012 Kodewerk Ltd. All rights reserved
  • 50. Kodewerk tm Java Performance Services Suggest tenuring threshold should ~5 eliminate some copy costs Copyright 2012 Kodewerk Ltd. All rights reserved
  • 51. Kodewerk tm Run 4 Java Performance Services Configure eden to 180m maintain GC frequency S0/S1 to 60m each Eden + S0 + S1 <= Tenured 180+60+60=300+300=600m survivor ratio = 3 Tenured should be 5 (maybe 4) Copyright 2012 Kodewerk Ltd. All rights reserved
  • 52. Kodewerk Run 2 tm Java Performance Services Run 3 Run 4 Copyright 2012 Kodewerk Ltd. All rights reserved
  • 53. Kodewerk tm Run 4 CPU Java Performance Services 20 < CPU < 50 ~40% no change Copyright 2012 Kodewerk Ltd. All rights reserved
  • 54. Kodewerk tm Java Performance Services ParNew is working about the same (was 1.42 runs/sec) GC puase remains about the same (was 3.13%) Much improved memory footprint 600m vs. 1024m Copyright 2012 Kodewerk Ltd. All rights reserved
  • 55. Kodewerk tm Java Performance Services GC adapts to a configuration we calculated Copyright 2012 Kodewerk Ltd. All rights reserved
  • 56. Kodewerk tm Java Performance Services Copyright 2012 Kodewerk Ltd. All rights reserved
  • 57. Kodewerk tm Java Performance Services Could the JVM have done this on it’s own? Copyright 2012 Kodewerk Ltd. All rights reserved
  • 58. Kodewerk tm Yeabut.... Java Performance Services Set max heap 1G, new ratio and survivor ratio to 1 JVM will produce identical results but only after a warmup and only under a set of ideal conditions results can vary run to run Copyright 2012 Kodewerk Ltd. All rights reserved
  • 59. Questions Copyright 2012 Kodewerk Ltd. All rights reserved