SlideShare une entreprise Scribd logo
1  sur  79
Télécharger pour lire hors ligne
How long can you afford to Stop The World?
Strategies to overcome long application pause times caused by Java GC
Berlin, May 22. 2013 | Eric Hubert - Strategy & Architecture
The information and evaluations expressed in this presentation are based on the author‘s
personal experiences and knowledge.
They do not necessarily reflect the views of Jesta Digital.
The author makes no warranties of any kind regarding the accuracy and veracity of information
and data provided.
No one shall rely on any of the published test results which are inherently environment-specific.
Readers are strongly encouraged to conduct own testing in their specific environment which
may or may not show different results.
All mentioned trademarks are property of their respective owners.
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Disclaimer
• Developing software for about 20 years
• More than 10 years experience in the Enterprise Java world (JDK 1.2)
• Prior Jesta worked for debis Systemhaus, T-Systems and Adesso
• Working for Jesta since 2007 (formerly Jamba!, Fox Mobile)
• Currently leading „Strategy & Architecture“ team focused on
– Strategic development of platform infrastructure and middleware
– Automation of software build-, packaging-, testing- , deployment-, release-
and application monitoring processes
– Close collaboration with cross-functional teams and central system
administration/operations team
• Contact: eric.hubert@jestadigital.com, XING, Linked in
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
About me
Agenda
• Motivation and Scope
• Summary of Java Memory Management Basics / GC Analysis
• Discussion of Different Strategies to overcome GC Pause Time issues
• Future Perspectives
• Open Discussion
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Motivation
• The demand to process large quantities of data in memory is steadily
increasing:
– More and more data to process and analyze in shorter times
(near-time/real time business requirements)
– Availability of commodity servers with up to 2 TB of RAM
(over the past decades available memory grew ≈ 100x every 10 years)
– Memory is still by far the fastest storage technology
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Motivation
• Java GC can heavily impact application performance, especially in terms of
latency / responsiveness (multi-second pause times on multi GB heaps)
• The runtime of most GC algorithms is proportional to the size of the live
set of objects  the larger the Heap the larger the pause times
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Storage Technology Random Access Latency
Registers 1-3 ns
CPU L1 Cache 2-8 ns
CPU L2 Cache 5-12 ns
Memory (RAM) 10-60 ns
High-speed network 10,000-30,000ns (10-30µs)
Solid State Disk (SSD) Drives 70,000-120,000ns (70-120µs)
Hard Disk Drives 3,000,000-10,000,000ns (3-10ms)
[REF_01] – Random Access Latencies of Storage Technologies
Motivation / Scope
• There are multiple strategies to overcome/minimize application pause
time issues related to Garbage Collection
• Nevertheless most talks, blog posts and other information sources center
on JVM tuning
(choice of collector algorithms, hints to improve promotion between
generations etc.)
• Most people know at least the most frequently used JVM GC tuning
arguments, but only some know basics of the automated memory
management and alternative strategies
• OOME causes, memory leaks, heap analysis etc. out of scope
• Not going to stress you with excessive JVM tuning options either
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Out of Scope - HotSpot GC Tuning Details
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
[REF_02] Devoxx FR 2012 „Death by Pauses“ by Frank Pavageau
Scope
• Ensure all attendees are aware of enough of the memory management
basics in order to at least understand
– The reason of long GC pauses
– How to verify an application unresponsiveness was caused by GC
• The main goal of my talk is to provide you with a broader view on
strategies to solve application pause times due to GC activity
• Will not deep dive into any of those strategies, but explain each approach,
discuss the pros and cons (as well as limitations and side- effects)
• If applicable will provide pointers to information sources covering more
details
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Automatic Memory Management Basics
• Responsibilities of Automatic Memory Management
• Basic Garbage Collector Algorithms / Important Terms
• Concept of Generations
• Common Triggers of Full GC
• Analysis of GC behavior / Information Sources
• Memory Performance Triangle
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Responsibilities of Automatic Memory Management
• Service provided by a “managed runtime” (e.g. the Java Virtual Machine)
in which the program executes
– Assisted allocation
– Managed access to objects and their fields
– Automatic de-allocation of objects (Garbage Collection)
• Ensures that objects remain as long as they are in use
• Deems objects with no incoming references from other live objects as
garbage
• Ensures that objects that are no longer required are thrown away to free
up the memory they occupy for new objects
• Ensures any finalize method is run before the object is thrown away
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Garbage Collectors – Classification (1)
• Serial versus Parallel
– Serial: Only one GC task at a time (only single CPU core used)
– Parallel: Multiple GC tasks are performed in parallel (multiple CPU core usage)
• Stop-The-World (STW) versus (Mostly) Concurrent
– STW: app threads are suspended during whole GC
– Concurrent: app threads are executed while GC tasks are performed
• Incremental
– Performs a garbage collection operation or phase as a series of smaller
operations with gaps in between
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Garbage Collectors – Classification (2)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Mostly-
[REF_03] Memory Management in the Java HotSpot VM
Garbage Collectors – Classification (3)
• Reference Counting / Tracing
– Ref. Counting: No longer in practical use due to reference cycle problematic
– Tracing: Currently most common; either single phase copy or multiple phases
(mark and optionally sweep and/or compact)
• Copying versus Non-compacting versus Compacting
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Garbage Collectors – Simplified View (Tracing)
• Find and reclaim unreachable objects
> Trace the heap starting at the roots
(thread stacks, static fields, operands of executed expression)
> Visits every live object
> Anything not visited is unreachable
> Therefore garbage
• If you can follow a chain of references from a root to a particular object,
then that object is "strongly" referenced. It will not be collected.
• Referenced objects are also called „live objects“ or “live set”
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Garbage Collection – Basic Algorithms (1)
• Copy/Scavenge
– Copy all live objects starting from the roots in a single pass operation from a
source space to a target space and reclaim source space (effectively a move
operation)
• At the beginning all objects are in source space and all references point to source
space
• Start at the roots, copy any reachable object to target space and correct references
while doing so
• At the end of copy all objects are in target space and all references point to target
space; source space can be completely cleared
– Amount of work is generally linear to the „live set“
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Garbage Collection – Basic Algorithms (2)
• Mark / Sweep / (Compact)
– Mark any object reachable as live
– Scan heap for objects not marked live (traced in a kind of free-list)
(the sweep step is generally linear to the entire heap size, not just the live set)
– Over time, memory fragments
• Slower allocation
• Longer sweep phases
• Risk not having large enough contiguous space for allocation of large objects; can
result in OOME
– Compaction moves (relocates) live objects together to reclaim contiguous
empty space; all object references need to be corrected (remap); compacting
is an expensive /time consuming operation
– A mark/sweep collector would not be a good choice for young generation, as
it will not gain efficiency from the sparseness
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Garbage Collection – Basic Algorithms (3)
• Mark / Sweep / (Compact)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
[REF_04] Mark-Sweep-Compact – Keith D. Gregory
Garbage Collection – Basic Algorithms (4)
• Mark / Compact
– Reachable objects are marked
– Compacting step relocates the reachable (marked) objects either towards the
beginning of the heap area (in-place compaction) or to another location
(evacuating compaction)
– Mark and compact work are both linear to live set, while sweep work is linear
to heap size
– Consequently, a mark/compact collector is linear to live set only, giving it
similar efficiency characteristics to copying collectors
– Examle: Azul C4
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Concept of Generations / Generational GC
• Incorporate this typical object lifetime structure into GC
– Different heap areas for objects with different lifetime
– Mostly different GC algorithms for objects with different lifetime
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
[REF_05] The Art of Garbage Collection Turing – Angelika Langer & Klaus Kreft
Concept of Generations / Generational GC
• Generations are of new and survived objects
• Heap divided in zones by age of the objects
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
eden survivor tenured
Allocation of objects in
eden space
(experienced no GC )
2 alternately used
copy target spaces
(experienced several GCs)
Objects survived
multiple GCs
Young (nursery) generation tenured generation
(old generation)
objects
collected by
Minor and
Full GC
objects
collected only
by
Full GC
object lifetime
[REF_06] Based on Java 7 Garbage Collector G1 by Antons Kranga
Concept of Generations / Generational GC
• Focus collection efforts on young generation
– Normally live objects represent only relatively small percentage of space
– Promote objects living long enough to older generations
• Tends to be much more efficient; great way to keep up with high allocation
rate
• Only collect older generation as it fills up
• Requires a “Remembered set”: a way to track all references into the young
generation from the outside
• Usually want to keep surviving objects in young generation for a while
before promoting them to the old generation:
– Immediate promotion can dramatically reduce generational filter efficiency
– Waiting too long to promote can dramatically increase copying work
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Common Triggers of Full GC
• Completely JVM implementation specific, more specifically it also depends
on selected GC algorithms
• “Common“ triggers in Oracle HotSpot JVM are:
– Old generation or permanent generation filled to a certain percentage
– Calling System.gc() (unless JVM option -XX:+DisableExplicitGC is set)
– Not enough free space in survivor space to copy objects from eden space
– Space extends or shrinkage (also applies to PermGen)
• Verification via gc logs and/or Java MBeans
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Analysis of GC behavior / Information Sources (1)
• GC traces from JVM
-XX:+PrintGC (same as -verbose:gc )
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps (since JDK 6 Update 6)
-Xloggc:logs/gc.log
-XX:GCLogFileSize=50M
-XX:NumberOfGCLogFiles=3
-XX:+UseGCLogFileRotation
Addition diagnose options (trouble shooting / tuning)
-XX:+PrintTenuringDistribution
-XX:+PrintHeapAtGC
-XX:+TraceClassLoading / -XX:+TraceClassUnloading
-XX:+PrintGCApplicationStoppedTime (Warning: misleading – all JVM safepoints)
-XX:+PrintSafepointStatistics (can be used for verification)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Analysis of GC behavior / Information Sources (2)
• Example of STW Pause caused by Full GC using Parallel GC
[Full GC [PSYoungGen: 8523K->0K(188160K)]
[PSOldGen: 574126K->428865K(575808K)] 582650K->428865K(763968K)
[PSPermGen: 115404K->115404K(246144K)], 4.8381260 secs]
• Example of STW Pauses caused by non-concurrent phases of CMS GC
[GC [1 CMS-initial-mark: 1477934K(1835008K)] 1521654K(2053504K),
0.0902490 secs]
[1 CMS-remark: 3717734K(4023936K)] 3810187K(4177280K), 1.0523700 secs]
• Examples of STW Pauses caused by fallback of CMS GC to Serial Old GC
(concurrent mode failure): 1784934K->1309805K(1926784K), 3.6729840 secs]
1927090K->1309805K(2080128K), [CMS Perm : 94690K->93690K(131072K)],
3.7968250 secs]
Hint: -XX:CMSInitiatingOccupancyFraction=<xx> and -XX:+UseCMSInitiatingOccupancyOnly
GC ParNew (promotion failed): 153344K->153344K(153344K), 0.1724000
secs]1574.221: [CMS: 2786273K->2531770K(4023936K), 5.5668010 secs]
2926282K->2531770K(4177280K), [CMS Perm : 94733K->92808K(131072K)],
5.7397890 secs]
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Analysis of GC behavior / Information Sources (3)
• Standard Java GC-related Management Beans (JMX)
– Can be used for (remote) real-time monitoring of GC behavior and memory
usage
– MBean names are Garbage Collector specific
 we use custom code for normalization to streamline monitoring config
– java.lang:type=GarbageCollector,name=<collector name>
• Young Gen: Copy, ParNew, PS Scavenge, G1 Young Generation
• Old Gen: MarkSweepCompact , PS MarkSweep, ConcurrentMarkSweep,
G1 Old Generation
• Metrics: CollectionCount, CollectionTime, LastGcInfo (Composite)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Analysis of GC behavior / Information Sources (4)
• Standard Memory Management Beans
– java.lang:type=Memory
• Metrics: HeapMemoryUsage (Composite: init, committed, usage, max)
– java.lang:type=MemoryPool,name=<space name>
• Eden: Eden Space, Par Eden Space, PS Eden Space, G1 Eden
• Survivor: Survivor Space, Par Survivor Space, PS Survivor Space, G1 Survivor
• Old: Tenured Gen, PS Old Gen, CMS Old Gen, G1 Old Gen
• Perm: Perm Gen, PS Perm Gen, G1 Perm Gen
• Metrics: Usage (init, committed, max, used)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Analysis of GC behavior / Information Sources (4)
• Custom GC Management Bean
– MajorCollectionCount
– MajorCollectionTime
– MinorCollectionCount
– MinorCollectionTime
– CumulatedCollectionTime
– LastMajorCollectionDuration
– LastMajorCollectionMemoryReduction
– LastMajorCollectionStartTime
– LastMajorCollectionEndTime
– TenuredCollector
– YoungCollector
– Uptime
• Warning: CollectionTime <> STW Pause Time for Concurrent Collectors
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – Command Line Tools
1) jstat/jstad/jps
Usage: jstat -help|-options
jstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]]
Example output – Live Server instance:
jstat -gc 30731 1s 10
S0C S1C S0U S1U EC EU OC OU
3520.0 3520.0 2593.7 0.0 28224.0 2688.8 261728.0 184199.8
PC PU YGC YGCT FGC FGCT GCT
43172.0 25851.9 168136 978.259 1021 4.195 982.454
– Can only be used to calculate averages or with short update intervals
– Use option „-gcutil“ if you rather want to see space usage percentages
– jps helps to determine vmid (but mostly maps to PID anyway)
– jstatd is required for remote usage of jstat
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (1)
Gcviewer – GC trace analyzer
• Originally developed by tagtraum industries (only maintained until 2008)
• Fork: https://github.com/chewiebug/GCViewer/downloads
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (2)
HPjmeter
• GC log analyzer and monitoring (the latter for HP UX)
• Download: www.hp.com/go/hpjmeter
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (3)
HPjmeter
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (4)
JConsole
• Part of JDK
• Can be used for monitoring of local (jvmid/pid) or remote (JMX RMI) JVM
service:jmx:rmi:///jndi/rmi://<remote-machine>:<port>/jmxrmi
or if behind firewall and using custom jmx rmi proxy:
service:jmx:rmi://<remote-machine>:<proxyport>/jndi/rmi://<remote-
machine>:<port>/jmxrmi
• Integrated MBean browser
• Shows active JVM options, GC info and more runtime information
• Can be used to verify memory/gc behavior in realtime
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (5)
JConsole
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (6)
Visual VM with Visual GC Plugin
• Part of JDK
• Based on jvmstat (local monitoring via jvmid, remote requires jstad)
• Many other plugins available (also MBean browser)
• Shows active JVM options and other runtime information (not GC algos)
• Can be used to verify memory/gc behavior in realtime
• Very detailed view including information regarding survivor space usage
as well as age information (histogram – not available for all algorithms)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (7)
Visual VM with Visual GC Plugin
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (8)
IBM GCMV
• Eclipse RCP Application (can also be installed as plugin in Eclipse)
• Loads gc log file similar to gcviewer and provides statistics and graphs
• nice capability to zoom into pause time graph area
• Mainly written for IBM J9, but most parts also work for Oracle JVMs
• Update Site:
http://download.boulder.ibm.com/ibmdl/pub/software/isa/isa410/produ
ction/
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (9)
IBM GCMV
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (10)
JHiccup
• Small Java tool from Azul Systems to demonstrate application hiccups
(primarily caused by GC, or any other JVM safepoint/OS jitter etc.)
• Either run from Command Line (script wrapping java command) or as
javaagent
• Writes logfiles which can later be loaded in Excel to render nice diagrams
by hitting a button (macros need to be active)
• Possibility to compare percentile values against expectations (SLA)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Analysis – GUI Tools (11)
JHiccup – Example Graphs of Telco App
• More details/examples later in this presentation …
• Download: http://www.azulsystems.com/downloads/jHiccup
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
GC Tuning – Memory Performance Triangle
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Memory footprint
Throughput Latency
Strategies to overcome GC Pause Time issues
1. Tuning of the JVM Runtime Behavior
2. Reduce memory footprint of the application
3. More powerful hardware (more RAM/CPU cores)
4. Distribute processing to multiple JVMs (with Remote Communication)
5. Custom Off-heap memory management
6. Switch to JVM implementation with more efficient Memory Management
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
1. Tuning of the JVM Runtime Behavior (1)
• Structured Approach - Preconditions
– Knowledge about Java Memory Management
• Understanding how the memory is organized in the JVM to be tuned
• Knowing the options to change GC related runtime behavior and their limits
– Effect of Garbage Collector Choice
– Effect of Memory Space Sizing
– Effect of other collector-specific configuration switches
– Knowledge about GC Analysis
• Knowing what to measure
• Knowing how to measure
• Knowing how to interpret metrics
– Knowledge about GC Tuning
• Know at least how to approach a tuning
– Know your Operational Requirements
– Have one or multiple concrete Tuning Goals prior to any modification!
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
1. Tuning of the JVM Runtime Behavior (2)
• If motivator is concrete performance issue (e.g. large pause time)
– First ensure the problem is really GC-related!
– Verify current GC configuration and analyze current GC behavior
– Evaluate your chances of improvement by runtime configuration tuning
• Verify your hardware and OS resources
• Verify object allocation rate
• Verify occupancy of tenured generation after Full GC
• Set those measures in relation to your goals
• Decide whether to proceed
– Use a comparable test environment with comparable workload to replicate
your issue (automate tests!)
– Capture baseline data, do small changes at a time and compare with baseline
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
1. Tuning of the JVM Runtime Behavior (3)
• Where are the large pauses?  typically old gen
• Start to tune young gen!
• First verify reasons of promotion (young  old), depending on outcome
– Think of increasing new size (decrease NewRatio value); do it stepwise and
verify result
– Think of increasing survivor spaces (SurvivorRatio)
– Think of increasing age threshold to avoid too early promotion to old gen
• verify total heap size, think of decreasing it (if possible)
• Proceed with old gc tuning
• Switch collector, try to use CMS (-XX:+UseConcMarcSweepGC)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Young Old
1. Tuning of the JVM Runtime Behavior (4)
• Generational Oracle HotSpot JVM (6 Collector choices/combinations)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
(G1 Young Generation) G1 (G1 Old Generation)
-XX:+UseG1GC
Serial Young
(DefNew : Copy)
-XX:+UseSerialGC
Concurrent Old
ConcurrentMarkSweep
-XX:+UseConcMarkSweepGC
Serial Old
(MarkSweepCompact)
Parallel Young
(ParNew : ParNew)
-XX:+UseParNewGC
Parallel Old
(PS OldGen - PS MarkSweep)
-XX:+UseParallelOldGC
Parallel Scavenge
(PSYoungGen : PS Scavenge)
-XX:+UseParallelGC
Fallback
-XX:-UseParNewGC
Fallback
1. Tuning of the JVM Runtime Behavior (5)
• JVM attempts to use reasonable defaults in all areas, but also offers a large
number of feature switches (currently more than 600)
• Useful resources to gather details:
– Official Oracle JVM documentation (lists about 90 options)
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-
140102.html
– Use JVM build-in listing functions
java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal
For adventurous guys add (Please don’t use any of those in production!)
-XX:+UnlockExperimentalVMOptions
– Choose one of the unofficial „complete references“ (gathered from source), e.g.
http://www.pingtimeout.fr/2012/05/jvm-options-complete-reference.html
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
1. Tuning of the JVM Runtime Behavior (6)
• Assessment
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Pros Cons
can drastically improve performance
(e.g. reduce maximum pause times
and/or improve throughput)
quite a lot of knowledge about
memory management and
implementation specific switches
required
relatively quickly to apply (depending
on knowledge and experience)
danger to optimize for the moment
(many variants: load, functionality
used, software changes)
needs to be carefully monitored and
repeated with each redeployment /
changed use
heavily implementation dependent /
can change with each minor JVM
version update
2. Reduce Memory Footprint of the application
• Sometimes easier said than actually done
• Generally one should avoid too much premature optimizations
• Rather frequently use heap dumps with memory analyzer or memory
profiler and verify proper data structure usage in development iterations
• Look out for usage of wrong scopes, e.g. mistakenly declared variables
within loops although not needed (unnecessary allocation pressure)
• Only load the amount of data in memory you need to process (e.g. from
some persistent store)
• For large amounts of objects carefully select data structures (verify
overhead – fixed and per entry)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
2. Reduce Memory Footprint of the application
• Assessment
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Pros Cons
high memory savings possible
(e.g. reduction of allocation rate and/or
long-lived objects by up to >50%) also
resulting in much smaller pause times
rather high, consistent effort
can have bigger positive impact than
any runtime tuning
can negatively impact execution time if
not properly applied
can introduce bugs if existing code
needs to be changed
3. More Powerful Hardware (RAM/CPU cores)
• Very much depending on starting situation whether more computing
resources can help to solve GC issues
– e.g. application is heavily CPU bound and not enough CPU cycles to properly
run GC concurrently
– or maximum heap sizes should be increased, but not enough RAM
• The VM implementation and the chosen GC algorithms have a big impact
as well
• If live set > 1 or 2 GB and currently using parallel GC on only two CPU
cores, increasing the heap size, switching to CMS and increasing the
number of CPU cores (thus GC threads) can have a large effect
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
3. More Powerful Hardware (RAM/CPU cores)
• Assessment
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Pros Cons
not much working effort to realize involved costs
may only mask underlying problems
until a later stage (e.g. increased load)
4. Distribute Memory Processing to multiple JVMs
• Sometimes easy, sometimes harder
• If we are talking about a mostly stateless application with a rather small
amount of long lived objects horizontal scaling is quite easy (using proper
loadbalancing and failover)
• Long-lived data needs to be somehow partitioned/sharded in order to
improve efficiency (either manually or by using products supporting
distributed memory structures aka. DataGrids – like Hazelcast, Infinispan,
Terracotta, GridGain, Coherence etc.)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
4. Distribute Memory Processing to multiple JVMs
• Assessment
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Pros Cons
depending on nature of application
Java heap usage per instance can be
drastically reduced
if existing application, distribution may
need some re-architecture
if memory issues are the only reason to
massively scale horizontally one
shouldn‘t forget about increased
complexity, operational overhead and
total memory overhead
5. Custom Off-Heap Memory Management (1)
• sun.misc.Unsafe
(internal implementation, dangerous, non-portable, and volatile)
• java.nio.ByteBuffer#allocateDirect (since JDK 1.4)
• Maximum size to be set with –XX:MaxDirectMemorySize=
• You have to use some serialization/deserialization mechanism
• Java‘s default serialization/deserialization is not very fast
• Two sub strategies:
– Dynamic size and merging: no memory wasted, but suffers fragmentation
(synchronization at allocation/deallocation)
– Fixed size buffer allocation: no fragmentation, but memory wasted
• Proper cleanup not quite elegant to achieve (relies on finalizer )
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
5. Custom Off-Heap Memory Management (2)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
static {
Method directBufferCleanerX = null;
Method directBufferCleanerCleanX = null;
boolean v;
try {
directBufferCleanerX =
Class.forName("java.nio.DirectByteBuffer").getMethod("cleaner");
directBufferCleanerX.setAccessible(true);
directBufferCleanerCleanX =
Class.forName("sun.misc.Cleaner").getMethod("clean");
directBufferCleanerCleanX.setAccessible(true);
v = true;
} catch (Exception e) {
v = false;
}
CLEAN_SUPPORTED = v;
directBufferCleaner = directBufferCleanerX;
directBufferCleanerClean = directBufferCleanerCleanX;
}
Lucene/Elastic Search Code:
within inner class in interface
org.apache.lucene.store.
bytebuffer.ByteBufferAllocator
forked to other projects like JBoss Netty
Custom Off-Heap Memory Management (3)
• Projects and products using this strategy:
– Oracle Coherence
– GigaSpaces, (to be validated)
– Hazelcast (Enterprise Edition)
– GridGain
– Terracotta BigMemory
– Lucene / Elastic Search
• Open Frameworks to use this strategy
– Apache DirectMemory (Serialization via Protostuff)
– FST - Fast Serialization
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
5. Custom Off-Heap Memory Management (4)
• Assessment:
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Pros Cons
can reduce GC overhead / max pause
times
quite tricky to get right, extreme
implementations end up in own GC
„useful“ usage limited to simple/flat
data structures (key-value) access;
usage as medium speed tier in Caches
off-heap allocation is a lot slower than
on Java-heap allocatoin
either memory waste or fragmentation
standard heap analysis tooling does not
apply, second set of tooling required
6. JVM with more efficient Memory Management (1)
The Ultimate JVM GC Tuning Guide
java -Xmx40g
ZING
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (2)
• Azul Zing Practical Evaluation / Comparison against Oracle HotSpot JVM
• Preparation:
– selected real software system as part of our platform showing
some GC issues in production
– setup test environment (single JVM instance) on VM with 16 GB, 8 cores
– created load test using real data captured from live systems
– single test run designed to last about one and a half hours
• Test Conduction:
– incrementally increased load (concurrent users) until Oracle Hotspot with
some default memory configuration showing severe issues
– changed memory sizing as well as GC algorithm in order to demonstrate issues
known from real live
– switched to untuned Azul Zing
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (3)
• Oracle HotSpot 1.6.0_43-b01, 64bit – 1 GB MaxHeap - ParallelGC:
-Xms768m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (4)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Oracle HotSpot 1.6.0_43-b01, 64bit – 1 GB MaxHeap - ParallelGC:
6. JVM with more efficient Memory Management (5)
• Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, ParallelGC
-Xms2048m –Xmx4096m -XX:PermSize=128m -XX:MaxPermSize=128m
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (6)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, ParallelGC
6. JVM with more efficient Memory Management (7)
• Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, CMS
-Xms4096m -Xmx4096m -XX:+UseConcMarkSweepGC //PermGen unchanged
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (8)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, CMS
6. JVM with more efficient Memory Management (9)
• Oracle Hotspot 1.6.0_43-b01, 64bit – 2 GB MaxHeap, CMS (tuned):
-Xms2g -Xmx2g -Xmn256m -XX:SurvivorRatio=4 -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=16
-XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly // PermGen unchanged
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (10)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Oracle Hotspot 1.6.0_43-b01, 64bit – 2 GB MaxHeap, CMS (tuned):
6. JVM with more efficient Memory Management (11)
• Azul Zing 1.6.0_33-ZVM_5.5.3.0-b5, 64bit – 10 GB MaxHeap, C4:
-Xmx10g
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (12)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Azul Zing 1.6.0_33-ZVM_5.5.3.0-b5, 64bit – 10 GB MaxHeap, C4
6. JVM with more efficient Memory Management (12)
• The efficiency of memory and thread management is up to each JVM
implementation
• Azul Systems offers an highly optimized commercial JVM called Zing which is
designed for low latency use with large (multi-GB heaps: 1 – > 300 GB)
• It uses a special read barrier (Loaded Value Barrier) to support concurrent
compaction, concurrent remapping, and concurrent incremental update
tracing
• Zing uses Generational GC, but the same base algorithm for both young and
old gen: C4 (Continuously Concurrent Compacting Collector (C4)
• Zing is built on top of a proprietary Loadable Linux Kernel Module
(multiple Linux distributions supported: RedHat, CentOs, SLES, Ubuntu, etc.)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
6. JVM with more efficient Memory Management (13)
• Comparison of peak mremap rates for 16 GB of remaps
• Zing has a custom memory and thread management implementation and
adds a production monitoring and management platform
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Active
Threads
Stock
Linux
Modified
Linux
Speedup
0 43.58 GB/sec (360ms) 4734.85 TB/sec (3us) >100,000x
1 3.04 GB/sec (5s) 1488.10 TB/sec (11us) >480,000x
2 1.82 GB/sec (8s) 1166.04 TB/sec (14us) >640,000x
4 1.19 GB/sec (13s) 913.74 TB/sec (18us) >750,000x
8 897.65 MB/sec (18s) 801.28 TB/sec (20us) >890,000x
12 736.65 MB/sec (21s) 740.52 TB/sec (22us) >1,000,000x
[REF_07] C4: The Continuously Concurrent Compacting Collector
6. JVM with more efficient Memory Management (14)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
[REF_08] Understanding Zing LX Memory Use
6. JVM with more efficient Memory Management (15)
• Assessment
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Pros Cons
incredibly low pause times not available in a free, unsupported form;
license costs as with other supported JVMs
no GC tuning required if not
aiming for microsecond
pause times
requires Azul Linux Kernel Module (dependent on
Linux distribution and Kernel ABI/signature change
policy some update restrictions and increased
operational effort possible)
predictable worst case pause
times
requires more memory to work efficiently (reserved
for Zing usage even if JVM is not running)
supports multi-GB large
heaps
a delay in which features in the major Oracle Java
Hotspot JVM releases are available in Zing, which is
aimed to be further reduced in the future
sophisticated monitoring in
production
(certain CPU requirements, but fulfilled by all
modern commodity server CPUs)
Future Perspectives (1)
• Garbage Collection and performance on virtualized environments is
among the hot future topics
• Oracle currently busy with GC „convergence“
(merging sources of former Bea JRockit and Sun Hotspot JVMs and
tooling), stabilization and performance improvements of G1 (future
standard?, only one GC „framework“ instead of currently three)
• General Goals according to talks to vendors like Oracle and IBM:
– Solve linear scaling problem (200ms @ 1GB → 20s @ 100GB)
(partly caused as result of deferring of “expensive operations”)
– Scale using result-based, concurrent and incremental (through partitioned
heap) garbage collection
– More flexible utilization of hardware (different data stores, SSD etc.)
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Future Perspectives (2)
• No interest of Linux Kernel community to integrate Azul’s improvements
(consequently they gave up on this)
• Future will show to what extend Azul Systems will actively participate in
the OpenJDK project and how this will influence upcoming Java SE
versions
• The gap between Azul Zing and all other JVM implementations in terms of
memory model efficiency seems to be large and not likely to be closed
anytime soon
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Discussion / Questions
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
References
• [REF_01] Systems Computing - Understanding CPU Caching and Performance
by Jon "Hannibal" Stokes
• [REF_02] Death By Pauses - Devoxx France 2012
by Frank Pavageau
• [REF_03] Memory Management in the Java HotSpot Virtual Machine
by Sun Microsystems
• [REF_04] Java Reference Objects
by Keith D. Gregory
• [REF_05] The Art of Garbage Collection Tuning
by Angelika Langer & Klaus Kreft
• [REF_06] Java7 Garbage Collector G1
by Antons Kranga
• [REF_07] C4: The Continuously Concurrent Compacting Collector
by Azul Systems (Gil Tene, Balaji Iyengar, Michael Wolf
• [REF_08] Understanding Zing LX Memory Use
by Azul Systems
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
Further Reading
• Official Oracle JVM options documentation (subset)
• Official Oracle JVM GC Tuning Documentation
• Java Garbage Collection Analysis and Tuning
• JavaOne 2012 - Gil Tene - Azul Systems - Understanding GC
• Alexey Ragozin - HotSpot JVM GC Options Cheat Sheet (v2)
• Alexey Ragozin - Understanding GC pauses in JVM, HotSpot's minor GC
• Alexey Ragozin - Understanding GC pauses in JVM, HotSpot's CMS collector
• Alexey Ragozin - Surviving 16GiB heap and greater
• Java OutOfMemoryError – Eine Tragödie in sieben Akten
• JavaOne 2012 - G1 Garbage Collector Tuning
• How to Monitor Java Garbage Collection | CUBRID Blog
• Everything I ever learned about jvm performance tuning (twitter)
• Displaying Java’s Memory Pool Statistics with VisualVM
BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture

Contenu connexe

Tendances

Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage CollectionAzul Systems Inc.
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage CollectionDoug Hawkins
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvmPrem Kuppumani
 
Java gc
Java gcJava gc
Java gcNiit
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlLeon Chen
 
(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag Session(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag SessionJens Hadlich
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageJelastic Multi-Cloud PaaS
 
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationLudovic Poitou
 
Memory management for_android_apps
Memory management for_android_appsMemory management for_android_apps
Memory management for_android_appsBin Shao
 
«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в JavaOlga Lavrentieva
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionAzul Systems, Inc.
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection TuningKai Koenig
 
Storing Cassandra Metrics
Storing Cassandra MetricsStoring Cassandra Metrics
Storing Cassandra MetricsChris Lohfink
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionHaribabu Nandyal Padmanaban
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuningJerry Kurian
 
JCConf 2020 - New Java Features Released in 2020
JCConf 2020 - New Java Features Released in 2020JCConf 2020 - New Java Features Released in 2020
JCConf 2020 - New Java Features Released in 2020Joseph Kuo
 
Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesSergey Podolsky
 

Tendances (20)

Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage Collection
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
Java gc
Java gcJava gc
Java gc
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
 
(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag Session(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag Session
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Garbage First & You
Garbage First & YouGarbage First & You
Garbage First & You
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
 
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
 
Memory management for_android_apps
Memory management for_android_appsMemory management for_android_apps
Memory management for_android_apps
 
«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage Collection
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
 
Storing Cassandra Metrics
Storing Cassandra MetricsStoring Cassandra Metrics
Storing Cassandra Metrics
 
Lp seminar
Lp seminarLp seminar
Lp seminar
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
JCConf 2020 - New Java Features Released in 2020
JCConf 2020 - New Java Features Released in 2020JCConf 2020 - New Java Features Released in 2020
JCConf 2020 - New Java Features Released in 2020
 
Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issues
 

En vedette

Memory efficient java tutorial practices and challenges
Memory efficient java tutorial practices and challengesMemory efficient java tutorial practices and challenges
Memory efficient java tutorial practices and challengesmustafa sarac
 
Java GC - Pause tuning
Java GC - Pause tuningJava GC - Pause tuning
Java GC - Pause tuningekino
 
Java Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyJava Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyDhanu Gupta
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Anna Shymchenko
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryachinth
 
Garbage collection
Garbage collectionGarbage collection
Garbage collectionMudit Gupta
 
Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"Ciklum Minsk
 
Java Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextJava Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextTomek Borek
 
Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimizationRajan Jethva
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GCKelum Senanayake
 
Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Ashish Jha
 

En vedette (20)

Java GC
Java GCJava GC
Java GC
 
Memory efficient java tutorial practices and challenges
Memory efficient java tutorial practices and challengesMemory efficient java tutorial practices and challenges
Memory efficient java tutorial practices and challenges
 
Java GC - Pause tuning
Java GC - Pause tuningJava GC - Pause tuning
Java GC - Pause tuning
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Java Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyJava Garbage Collection(GC)- Study
Java Garbage Collection(GC)- Study
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Java Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextJava Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and context
 
Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimization
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
 
Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)
 
Java memory model
Java memory modelJava memory model
Java memory model
 
The Java Memory Model
The Java Memory ModelThe Java Memory Model
The Java Memory Model
 
Java GC, Off-heap workshop
Java GC, Off-heap workshopJava GC, Off-heap workshop
Java GC, Off-heap workshop
 

Similaire à How long can you afford to Stop The World?

(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...
(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...
(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...DevOpsDays Tel Aviv
 
Feature-Oriented Software Evolution
Feature-Oriented Software EvolutionFeature-Oriented Software Evolution
Feature-Oriented Software EvolutionLeonardo Passos
 
Big Data for Local Context
Big Data for Local ContextBig Data for Local Context
Big Data for Local ContextGeorge Percivall
 
IRJET - Design and Analysis of Clubhouse
IRJET - Design and Analysis of ClubhouseIRJET - Design and Analysis of Clubhouse
IRJET - Design and Analysis of ClubhouseIRJET Journal
 
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...MongoDB
 
SC17 Panel: Energy Efficiency Gains From HPC Software
SC17 Panel: Energy Efficiency Gains From HPC SoftwareSC17 Panel: Energy Efficiency Gains From HPC Software
SC17 Panel: Energy Efficiency Gains From HPC Softwareinside-BigData.com
 
Beit 381 se lec 11,12 - 41 - 12 mar16 - 3 & 4 of 4 - sdlc incremental and ...
Beit 381 se lec 11,12  -  41 -  12 mar16 - 3 & 4 of 4 - sdlc incremental and ...Beit 381 se lec 11,12  -  41 -  12 mar16 - 3 & 4 of 4 - sdlc incremental and ...
Beit 381 se lec 11,12 - 41 - 12 mar16 - 3 & 4 of 4 - sdlc incremental and ...babak danyal
 
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...Lucidworks
 
PrepData4Mobilty (Building Blocks) Methodological approach and Roadmap.pptx
PrepData4Mobilty (Building Blocks)  Methodological approach and Roadmap.pptxPrepData4Mobilty (Building Blocks)  Methodological approach and Roadmap.pptx
PrepData4Mobilty (Building Blocks) Methodological approach and Roadmap.pptxFIWARE
 
Challenges and complexities in application of LCA approaches in the case of I...
Challenges and complexities in application of LCA approaches in the case of I...Challenges and complexities in application of LCA approaches in the case of I...
Challenges and complexities in application of LCA approaches in the case of I...Reza Farrahi Moghaddam, PhD, BEng
 
IPRES 2014 paper presentation: significant environment information for LTDP
IPRES 2014 paper presentation: significant environment information for LTDPIPRES 2014 paper presentation: significant environment information for LTDP
IPRES 2014 paper presentation: significant environment information for LTDPFabio Corubolo
 
AmI 2015 - Design Process
AmI 2015 - Design ProcessAmI 2015 - Design Process
AmI 2015 - Design ProcessFulvio Corno
 
Microservices at Scale: How to Reduce Overhead and Increase Developer Product...
Microservices at Scale: How to Reduce Overhead and Increase Developer Product...Microservices at Scale: How to Reduce Overhead and Increase Developer Product...
Microservices at Scale: How to Reduce Overhead and Increase Developer Product...DevOps.com
 
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014Yuval Yeret
 
Public Seminar_Final 18112014
Public Seminar_Final 18112014Public Seminar_Final 18112014
Public Seminar_Final 18112014Hossam Hassan
 
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...Spark Summit
 
Software process models
Software process modelsSoftware process models
Software process modelsMalik WaQas
 

Similaire à How long can you afford to Stop The World? (20)

(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...
(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...
(Ignite) OPEN SOURCE - OPEN CHOICE: HOW TO CHOOSE AN OPEN-SOURCE PROJECT, HIL...
 
Feature-Oriented Software Evolution
Feature-Oriented Software EvolutionFeature-Oriented Software Evolution
Feature-Oriented Software Evolution
 
Big Data for Local Context
Big Data for Local ContextBig Data for Local Context
Big Data for Local Context
 
IRJET - Design and Analysis of Clubhouse
IRJET - Design and Analysis of ClubhouseIRJET - Design and Analysis of Clubhouse
IRJET - Design and Analysis of Clubhouse
 
tip oopt pse-summit2017
tip oopt pse-summit2017tip oopt pse-summit2017
tip oopt pse-summit2017
 
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
 
SC17 Panel: Energy Efficiency Gains From HPC Software
SC17 Panel: Energy Efficiency Gains From HPC SoftwareSC17 Panel: Energy Efficiency Gains From HPC Software
SC17 Panel: Energy Efficiency Gains From HPC Software
 
Beit 381 se lec 11,12 - 41 - 12 mar16 - 3 & 4 of 4 - sdlc incremental and ...
Beit 381 se lec 11,12  -  41 -  12 mar16 - 3 & 4 of 4 - sdlc incremental and ...Beit 381 se lec 11,12  -  41 -  12 mar16 - 3 & 4 of 4 - sdlc incremental and ...
Beit 381 se lec 11,12 - 41 - 12 mar16 - 3 & 4 of 4 - sdlc incremental and ...
 
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
 
PrepData4Mobilty (Building Blocks) Methodological approach and Roadmap.pptx
PrepData4Mobilty (Building Blocks)  Methodological approach and Roadmap.pptxPrepData4Mobilty (Building Blocks)  Methodological approach and Roadmap.pptx
PrepData4Mobilty (Building Blocks) Methodological approach and Roadmap.pptx
 
Challenges and complexities in application of LCA approaches in the case of I...
Challenges and complexities in application of LCA approaches in the case of I...Challenges and complexities in application of LCA approaches in the case of I...
Challenges and complexities in application of LCA approaches in the case of I...
 
IPRES 2014 paper presentation: significant environment information for LTDP
IPRES 2014 paper presentation: significant environment information for LTDPIPRES 2014 paper presentation: significant environment information for LTDP
IPRES 2014 paper presentation: significant environment information for LTDP
 
AmI 2015 - Design Process
AmI 2015 - Design ProcessAmI 2015 - Design Process
AmI 2015 - Design Process
 
Kubisys Overview
Kubisys OverviewKubisys Overview
Kubisys Overview
 
Microservices at Scale: How to Reduce Overhead and Increase Developer Product...
Microservices at Scale: How to Reduce Overhead and Increase Developer Product...Microservices at Scale: How to Reduce Overhead and Increase Developer Product...
Microservices at Scale: How to Reduce Overhead and Increase Developer Product...
 
Edge computing system for large scale distributed sensing systems
Edge computing system for large scale distributed sensing systemsEdge computing system for large scale distributed sensing systems
Edge computing system for large scale distributed sensing systems
 
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
 
Public Seminar_Final 18112014
Public Seminar_Final 18112014Public Seminar_Final 18112014
Public Seminar_Final 18112014
 
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
 
Software process models
Software process modelsSoftware process models
Software process models
 

Plus de Java Usergroup Berlin-Brandenburg

Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)
Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)
Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)Java Usergroup Berlin-Brandenburg
 
Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02
Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02
Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02Java Usergroup Berlin-Brandenburg
 

Plus de Java Usergroup Berlin-Brandenburg (19)

Microbenchmarks - Wer nicht weiß, was er misst misst Mist
Microbenchmarks - Wer nicht weiß, was er misst misst MistMicrobenchmarks - Wer nicht weiß, was er misst misst Mist
Microbenchmarks - Wer nicht weiß, was er misst misst Mist
 
Collections.compare(() -> JDK; Apache; Eclipse, Guava...});
Collections.compare(() -> JDK; Apache; Eclipse, Guava...});Collections.compare(() -> JDK; Apache; Eclipse, Guava...});
Collections.compare(() -> JDK; Apache; Eclipse, Guava...});
 
Built To Last - Nachhaltige Software-Entwicklung
Built To Last - Nachhaltige Software-EntwicklungBuilt To Last - Nachhaltige Software-Entwicklung
Built To Last - Nachhaltige Software-Entwicklung
 
Feature Toggles On Steroids
Feature Toggles On SteroidsFeature Toggles On Steroids
Feature Toggles On Steroids
 
Resilience mit Hystrix
Resilience mit HystrixResilience mit Hystrix
Resilience mit Hystrix
 
Analysis of software systems using jQAssistant and Neo4j
Analysis of software systems using jQAssistant and Neo4jAnalysis of software systems using jQAssistant and Neo4j
Analysis of software systems using jQAssistant and Neo4j
 
Get Back in Control of your SQL
Get Back in Control of your SQLGet Back in Control of your SQL
Get Back in Control of your SQL
 
Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)
Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)
Die fabelhafte Welt Java(Script)-getriebener Enterprise-WebApps (mit Ext JS)
 
Selbstvorstellung Steria Mummert Consulting
Selbstvorstellung Steria Mummert ConsultingSelbstvorstellung Steria Mummert Consulting
Selbstvorstellung Steria Mummert Consulting
 
Graphdatenbanken mit Neo4j
Graphdatenbanken mit Neo4jGraphdatenbanken mit Neo4j
Graphdatenbanken mit Neo4j
 
Jbosseapclustering 130605100557-phpapp02
Jbosseapclustering 130605100557-phpapp02Jbosseapclustering 130605100557-phpapp02
Jbosseapclustering 130605100557-phpapp02
 
Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02
Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02
Jbossas7alsplattformmodernerenterprise anwendungen-130604114410-phpapp02
 
JavaOne Update zur Java Plattform
JavaOne Update zur Java PlattformJavaOne Update zur Java Plattform
JavaOne Update zur Java Plattform
 
Java EE 7 - Overview and Status
Java EE 7  - Overview and StatusJava EE 7  - Overview and Status
Java EE 7 - Overview and Status
 
Restructuring
RestructuringRestructuring
Restructuring
 
Fighting Layout Bugs
Fighting Layout BugsFighting Layout Bugs
Fighting Layout Bugs
 
Die Java Plattform Strategie
Die Java Plattform StrategieDie Java Plattform Strategie
Die Java Plattform Strategie
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
Continuous Delivery in der Praxis
Continuous Delivery in der PraxisContinuous Delivery in der Praxis
Continuous Delivery in der Praxis
 

Dernier

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Dernier (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

How long can you afford to Stop The World?

  • 1. How long can you afford to Stop The World? Strategies to overcome long application pause times caused by Java GC Berlin, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 2. The information and evaluations expressed in this presentation are based on the author‘s personal experiences and knowledge. They do not necessarily reflect the views of Jesta Digital. The author makes no warranties of any kind regarding the accuracy and veracity of information and data provided. No one shall rely on any of the published test results which are inherently environment-specific. Readers are strongly encouraged to conduct own testing in their specific environment which may or may not show different results. All mentioned trademarks are property of their respective owners. BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Disclaimer
  • 3. • Developing software for about 20 years • More than 10 years experience in the Enterprise Java world (JDK 1.2) • Prior Jesta worked for debis Systemhaus, T-Systems and Adesso • Working for Jesta since 2007 (formerly Jamba!, Fox Mobile) • Currently leading „Strategy & Architecture“ team focused on – Strategic development of platform infrastructure and middleware – Automation of software build-, packaging-, testing- , deployment-, release- and application monitoring processes – Close collaboration with cross-functional teams and central system administration/operations team • Contact: eric.hubert@jestadigital.com, XING, Linked in BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture About me
  • 4. Agenda • Motivation and Scope • Summary of Java Memory Management Basics / GC Analysis • Discussion of Different Strategies to overcome GC Pause Time issues • Future Perspectives • Open Discussion BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 5. Motivation • The demand to process large quantities of data in memory is steadily increasing: – More and more data to process and analyze in shorter times (near-time/real time business requirements) – Availability of commodity servers with up to 2 TB of RAM (over the past decades available memory grew ≈ 100x every 10 years) – Memory is still by far the fastest storage technology BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 6. Motivation • Java GC can heavily impact application performance, especially in terms of latency / responsiveness (multi-second pause times on multi GB heaps) • The runtime of most GC algorithms is proportional to the size of the live set of objects  the larger the Heap the larger the pause times BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Storage Technology Random Access Latency Registers 1-3 ns CPU L1 Cache 2-8 ns CPU L2 Cache 5-12 ns Memory (RAM) 10-60 ns High-speed network 10,000-30,000ns (10-30µs) Solid State Disk (SSD) Drives 70,000-120,000ns (70-120µs) Hard Disk Drives 3,000,000-10,000,000ns (3-10ms) [REF_01] – Random Access Latencies of Storage Technologies
  • 7. Motivation / Scope • There are multiple strategies to overcome/minimize application pause time issues related to Garbage Collection • Nevertheless most talks, blog posts and other information sources center on JVM tuning (choice of collector algorithms, hints to improve promotion between generations etc.) • Most people know at least the most frequently used JVM GC tuning arguments, but only some know basics of the automated memory management and alternative strategies • OOME causes, memory leaks, heap analysis etc. out of scope • Not going to stress you with excessive JVM tuning options either BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 8. Out of Scope - HotSpot GC Tuning Details BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture [REF_02] Devoxx FR 2012 „Death by Pauses“ by Frank Pavageau
  • 9. Scope • Ensure all attendees are aware of enough of the memory management basics in order to at least understand – The reason of long GC pauses – How to verify an application unresponsiveness was caused by GC • The main goal of my talk is to provide you with a broader view on strategies to solve application pause times due to GC activity • Will not deep dive into any of those strategies, but explain each approach, discuss the pros and cons (as well as limitations and side- effects) • If applicable will provide pointers to information sources covering more details BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 10. Automatic Memory Management Basics • Responsibilities of Automatic Memory Management • Basic Garbage Collector Algorithms / Important Terms • Concept of Generations • Common Triggers of Full GC • Analysis of GC behavior / Information Sources • Memory Performance Triangle BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 11. Responsibilities of Automatic Memory Management • Service provided by a “managed runtime” (e.g. the Java Virtual Machine) in which the program executes – Assisted allocation – Managed access to objects and their fields – Automatic de-allocation of objects (Garbage Collection) • Ensures that objects remain as long as they are in use • Deems objects with no incoming references from other live objects as garbage • Ensures that objects that are no longer required are thrown away to free up the memory they occupy for new objects • Ensures any finalize method is run before the object is thrown away BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 12. Garbage Collectors – Classification (1) • Serial versus Parallel – Serial: Only one GC task at a time (only single CPU core used) – Parallel: Multiple GC tasks are performed in parallel (multiple CPU core usage) • Stop-The-World (STW) versus (Mostly) Concurrent – STW: app threads are suspended during whole GC – Concurrent: app threads are executed while GC tasks are performed • Incremental – Performs a garbage collection operation or phase as a series of smaller operations with gaps in between BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 13. Garbage Collectors – Classification (2) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Mostly- [REF_03] Memory Management in the Java HotSpot VM
  • 14. Garbage Collectors – Classification (3) • Reference Counting / Tracing – Ref. Counting: No longer in practical use due to reference cycle problematic – Tracing: Currently most common; either single phase copy or multiple phases (mark and optionally sweep and/or compact) • Copying versus Non-compacting versus Compacting BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 15. Garbage Collectors – Simplified View (Tracing) • Find and reclaim unreachable objects > Trace the heap starting at the roots (thread stacks, static fields, operands of executed expression) > Visits every live object > Anything not visited is unreachable > Therefore garbage • If you can follow a chain of references from a root to a particular object, then that object is "strongly" referenced. It will not be collected. • Referenced objects are also called „live objects“ or “live set” BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 16. Garbage Collection – Basic Algorithms (1) • Copy/Scavenge – Copy all live objects starting from the roots in a single pass operation from a source space to a target space and reclaim source space (effectively a move operation) • At the beginning all objects are in source space and all references point to source space • Start at the roots, copy any reachable object to target space and correct references while doing so • At the end of copy all objects are in target space and all references point to target space; source space can be completely cleared – Amount of work is generally linear to the „live set“ BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 17. Garbage Collection – Basic Algorithms (2) • Mark / Sweep / (Compact) – Mark any object reachable as live – Scan heap for objects not marked live (traced in a kind of free-list) (the sweep step is generally linear to the entire heap size, not just the live set) – Over time, memory fragments • Slower allocation • Longer sweep phases • Risk not having large enough contiguous space for allocation of large objects; can result in OOME – Compaction moves (relocates) live objects together to reclaim contiguous empty space; all object references need to be corrected (remap); compacting is an expensive /time consuming operation – A mark/sweep collector would not be a good choice for young generation, as it will not gain efficiency from the sparseness BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 18. Garbage Collection – Basic Algorithms (3) • Mark / Sweep / (Compact) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture [REF_04] Mark-Sweep-Compact – Keith D. Gregory
  • 19. Garbage Collection – Basic Algorithms (4) • Mark / Compact – Reachable objects are marked – Compacting step relocates the reachable (marked) objects either towards the beginning of the heap area (in-place compaction) or to another location (evacuating compaction) – Mark and compact work are both linear to live set, while sweep work is linear to heap size – Consequently, a mark/compact collector is linear to live set only, giving it similar efficiency characteristics to copying collectors – Examle: Azul C4 BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 20. Concept of Generations / Generational GC • Incorporate this typical object lifetime structure into GC – Different heap areas for objects with different lifetime – Mostly different GC algorithms for objects with different lifetime BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture [REF_05] The Art of Garbage Collection Turing – Angelika Langer & Klaus Kreft
  • 21. Concept of Generations / Generational GC • Generations are of new and survived objects • Heap divided in zones by age of the objects BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture eden survivor tenured Allocation of objects in eden space (experienced no GC ) 2 alternately used copy target spaces (experienced several GCs) Objects survived multiple GCs Young (nursery) generation tenured generation (old generation) objects collected by Minor and Full GC objects collected only by Full GC object lifetime [REF_06] Based on Java 7 Garbage Collector G1 by Antons Kranga
  • 22. Concept of Generations / Generational GC • Focus collection efforts on young generation – Normally live objects represent only relatively small percentage of space – Promote objects living long enough to older generations • Tends to be much more efficient; great way to keep up with high allocation rate • Only collect older generation as it fills up • Requires a “Remembered set”: a way to track all references into the young generation from the outside • Usually want to keep surviving objects in young generation for a while before promoting them to the old generation: – Immediate promotion can dramatically reduce generational filter efficiency – Waiting too long to promote can dramatically increase copying work BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 23. Common Triggers of Full GC • Completely JVM implementation specific, more specifically it also depends on selected GC algorithms • “Common“ triggers in Oracle HotSpot JVM are: – Old generation or permanent generation filled to a certain percentage – Calling System.gc() (unless JVM option -XX:+DisableExplicitGC is set) – Not enough free space in survivor space to copy objects from eden space – Space extends or shrinkage (also applies to PermGen) • Verification via gc logs and/or Java MBeans BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 24. Analysis of GC behavior / Information Sources (1) • GC traces from JVM -XX:+PrintGC (same as -verbose:gc ) -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps (since JDK 6 Update 6) -Xloggc:logs/gc.log -XX:GCLogFileSize=50M -XX:NumberOfGCLogFiles=3 -XX:+UseGCLogFileRotation Addition diagnose options (trouble shooting / tuning) -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+TraceClassLoading / -XX:+TraceClassUnloading -XX:+PrintGCApplicationStoppedTime (Warning: misleading – all JVM safepoints) -XX:+PrintSafepointStatistics (can be used for verification) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 25. Analysis of GC behavior / Information Sources (2) • Example of STW Pause caused by Full GC using Parallel GC [Full GC [PSYoungGen: 8523K->0K(188160K)] [PSOldGen: 574126K->428865K(575808K)] 582650K->428865K(763968K) [PSPermGen: 115404K->115404K(246144K)], 4.8381260 secs] • Example of STW Pauses caused by non-concurrent phases of CMS GC [GC [1 CMS-initial-mark: 1477934K(1835008K)] 1521654K(2053504K), 0.0902490 secs] [1 CMS-remark: 3717734K(4023936K)] 3810187K(4177280K), 1.0523700 secs] • Examples of STW Pauses caused by fallback of CMS GC to Serial Old GC (concurrent mode failure): 1784934K->1309805K(1926784K), 3.6729840 secs] 1927090K->1309805K(2080128K), [CMS Perm : 94690K->93690K(131072K)], 3.7968250 secs] Hint: -XX:CMSInitiatingOccupancyFraction=<xx> and -XX:+UseCMSInitiatingOccupancyOnly GC ParNew (promotion failed): 153344K->153344K(153344K), 0.1724000 secs]1574.221: [CMS: 2786273K->2531770K(4023936K), 5.5668010 secs] 2926282K->2531770K(4177280K), [CMS Perm : 94733K->92808K(131072K)], 5.7397890 secs] BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 26. Analysis of GC behavior / Information Sources (3) • Standard Java GC-related Management Beans (JMX) – Can be used for (remote) real-time monitoring of GC behavior and memory usage – MBean names are Garbage Collector specific  we use custom code for normalization to streamline monitoring config – java.lang:type=GarbageCollector,name=<collector name> • Young Gen: Copy, ParNew, PS Scavenge, G1 Young Generation • Old Gen: MarkSweepCompact , PS MarkSweep, ConcurrentMarkSweep, G1 Old Generation • Metrics: CollectionCount, CollectionTime, LastGcInfo (Composite) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 27. Analysis of GC behavior / Information Sources (4) • Standard Memory Management Beans – java.lang:type=Memory • Metrics: HeapMemoryUsage (Composite: init, committed, usage, max) – java.lang:type=MemoryPool,name=<space name> • Eden: Eden Space, Par Eden Space, PS Eden Space, G1 Eden • Survivor: Survivor Space, Par Survivor Space, PS Survivor Space, G1 Survivor • Old: Tenured Gen, PS Old Gen, CMS Old Gen, G1 Old Gen • Perm: Perm Gen, PS Perm Gen, G1 Perm Gen • Metrics: Usage (init, committed, max, used) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 28. Analysis of GC behavior / Information Sources (4) • Custom GC Management Bean – MajorCollectionCount – MajorCollectionTime – MinorCollectionCount – MinorCollectionTime – CumulatedCollectionTime – LastMajorCollectionDuration – LastMajorCollectionMemoryReduction – LastMajorCollectionStartTime – LastMajorCollectionEndTime – TenuredCollector – YoungCollector – Uptime • Warning: CollectionTime <> STW Pause Time for Concurrent Collectors BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 29. GC Analysis – Command Line Tools 1) jstat/jstad/jps Usage: jstat -help|-options jstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]] Example output – Live Server instance: jstat -gc 30731 1s 10 S0C S1C S0U S1U EC EU OC OU 3520.0 3520.0 2593.7 0.0 28224.0 2688.8 261728.0 184199.8 PC PU YGC YGCT FGC FGCT GCT 43172.0 25851.9 168136 978.259 1021 4.195 982.454 – Can only be used to calculate averages or with short update intervals – Use option „-gcutil“ if you rather want to see space usage percentages – jps helps to determine vmid (but mostly maps to PID anyway) – jstatd is required for remote usage of jstat BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 30. GC Analysis – GUI Tools (1) Gcviewer – GC trace analyzer • Originally developed by tagtraum industries (only maintained until 2008) • Fork: https://github.com/chewiebug/GCViewer/downloads BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 31. GC Analysis – GUI Tools (2) HPjmeter • GC log analyzer and monitoring (the latter for HP UX) • Download: www.hp.com/go/hpjmeter BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 32. GC Analysis – GUI Tools (3) HPjmeter BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 33. GC Analysis – GUI Tools (4) JConsole • Part of JDK • Can be used for monitoring of local (jvmid/pid) or remote (JMX RMI) JVM service:jmx:rmi:///jndi/rmi://<remote-machine>:<port>/jmxrmi or if behind firewall and using custom jmx rmi proxy: service:jmx:rmi://<remote-machine>:<proxyport>/jndi/rmi://<remote- machine>:<port>/jmxrmi • Integrated MBean browser • Shows active JVM options, GC info and more runtime information • Can be used to verify memory/gc behavior in realtime BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 34. GC Analysis – GUI Tools (5) JConsole BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 35. GC Analysis – GUI Tools (6) Visual VM with Visual GC Plugin • Part of JDK • Based on jvmstat (local monitoring via jvmid, remote requires jstad) • Many other plugins available (also MBean browser) • Shows active JVM options and other runtime information (not GC algos) • Can be used to verify memory/gc behavior in realtime • Very detailed view including information regarding survivor space usage as well as age information (histogram – not available for all algorithms) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 36. GC Analysis – GUI Tools (7) Visual VM with Visual GC Plugin BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 37. GC Analysis – GUI Tools (8) IBM GCMV • Eclipse RCP Application (can also be installed as plugin in Eclipse) • Loads gc log file similar to gcviewer and provides statistics and graphs • nice capability to zoom into pause time graph area • Mainly written for IBM J9, but most parts also work for Oracle JVMs • Update Site: http://download.boulder.ibm.com/ibmdl/pub/software/isa/isa410/produ ction/ BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 38. GC Analysis – GUI Tools (9) IBM GCMV BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 39. GC Analysis – GUI Tools (10) JHiccup • Small Java tool from Azul Systems to demonstrate application hiccups (primarily caused by GC, or any other JVM safepoint/OS jitter etc.) • Either run from Command Line (script wrapping java command) or as javaagent • Writes logfiles which can later be loaded in Excel to render nice diagrams by hitting a button (macros need to be active) • Possibility to compare percentile values against expectations (SLA) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 40. GC Analysis – GUI Tools (11) JHiccup – Example Graphs of Telco App • More details/examples later in this presentation … • Download: http://www.azulsystems.com/downloads/jHiccup BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 41. GC Tuning – Memory Performance Triangle BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Memory footprint Throughput Latency
  • 42. Strategies to overcome GC Pause Time issues 1. Tuning of the JVM Runtime Behavior 2. Reduce memory footprint of the application 3. More powerful hardware (more RAM/CPU cores) 4. Distribute processing to multiple JVMs (with Remote Communication) 5. Custom Off-heap memory management 6. Switch to JVM implementation with more efficient Memory Management BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 43. 1. Tuning of the JVM Runtime Behavior (1) • Structured Approach - Preconditions – Knowledge about Java Memory Management • Understanding how the memory is organized in the JVM to be tuned • Knowing the options to change GC related runtime behavior and their limits – Effect of Garbage Collector Choice – Effect of Memory Space Sizing – Effect of other collector-specific configuration switches – Knowledge about GC Analysis • Knowing what to measure • Knowing how to measure • Knowing how to interpret metrics – Knowledge about GC Tuning • Know at least how to approach a tuning – Know your Operational Requirements – Have one or multiple concrete Tuning Goals prior to any modification! BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 44. 1. Tuning of the JVM Runtime Behavior (2) • If motivator is concrete performance issue (e.g. large pause time) – First ensure the problem is really GC-related! – Verify current GC configuration and analyze current GC behavior – Evaluate your chances of improvement by runtime configuration tuning • Verify your hardware and OS resources • Verify object allocation rate • Verify occupancy of tenured generation after Full GC • Set those measures in relation to your goals • Decide whether to proceed – Use a comparable test environment with comparable workload to replicate your issue (automate tests!) – Capture baseline data, do small changes at a time and compare with baseline BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 45. 1. Tuning of the JVM Runtime Behavior (3) • Where are the large pauses?  typically old gen • Start to tune young gen! • First verify reasons of promotion (young  old), depending on outcome – Think of increasing new size (decrease NewRatio value); do it stepwise and verify result – Think of increasing survivor spaces (SurvivorRatio) – Think of increasing age threshold to avoid too early promotion to old gen • verify total heap size, think of decreasing it (if possible) • Proceed with old gc tuning • Switch collector, try to use CMS (-XX:+UseConcMarcSweepGC) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 46. Young Old 1. Tuning of the JVM Runtime Behavior (4) • Generational Oracle HotSpot JVM (6 Collector choices/combinations) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture (G1 Young Generation) G1 (G1 Old Generation) -XX:+UseG1GC Serial Young (DefNew : Copy) -XX:+UseSerialGC Concurrent Old ConcurrentMarkSweep -XX:+UseConcMarkSweepGC Serial Old (MarkSweepCompact) Parallel Young (ParNew : ParNew) -XX:+UseParNewGC Parallel Old (PS OldGen - PS MarkSweep) -XX:+UseParallelOldGC Parallel Scavenge (PSYoungGen : PS Scavenge) -XX:+UseParallelGC Fallback -XX:-UseParNewGC Fallback
  • 47. 1. Tuning of the JVM Runtime Behavior (5) • JVM attempts to use reasonable defaults in all areas, but also offers a large number of feature switches (currently more than 600) • Useful resources to gather details: – Official Oracle JVM documentation (lists about 90 options) http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp- 140102.html – Use JVM build-in listing functions java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal For adventurous guys add (Please don’t use any of those in production!) -XX:+UnlockExperimentalVMOptions – Choose one of the unofficial „complete references“ (gathered from source), e.g. http://www.pingtimeout.fr/2012/05/jvm-options-complete-reference.html BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 48. 1. Tuning of the JVM Runtime Behavior (6) • Assessment BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Pros Cons can drastically improve performance (e.g. reduce maximum pause times and/or improve throughput) quite a lot of knowledge about memory management and implementation specific switches required relatively quickly to apply (depending on knowledge and experience) danger to optimize for the moment (many variants: load, functionality used, software changes) needs to be carefully monitored and repeated with each redeployment / changed use heavily implementation dependent / can change with each minor JVM version update
  • 49. 2. Reduce Memory Footprint of the application • Sometimes easier said than actually done • Generally one should avoid too much premature optimizations • Rather frequently use heap dumps with memory analyzer or memory profiler and verify proper data structure usage in development iterations • Look out for usage of wrong scopes, e.g. mistakenly declared variables within loops although not needed (unnecessary allocation pressure) • Only load the amount of data in memory you need to process (e.g. from some persistent store) • For large amounts of objects carefully select data structures (verify overhead – fixed and per entry) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 50. 2. Reduce Memory Footprint of the application • Assessment BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Pros Cons high memory savings possible (e.g. reduction of allocation rate and/or long-lived objects by up to >50%) also resulting in much smaller pause times rather high, consistent effort can have bigger positive impact than any runtime tuning can negatively impact execution time if not properly applied can introduce bugs if existing code needs to be changed
  • 51. 3. More Powerful Hardware (RAM/CPU cores) • Very much depending on starting situation whether more computing resources can help to solve GC issues – e.g. application is heavily CPU bound and not enough CPU cycles to properly run GC concurrently – or maximum heap sizes should be increased, but not enough RAM • The VM implementation and the chosen GC algorithms have a big impact as well • If live set > 1 or 2 GB and currently using parallel GC on only two CPU cores, increasing the heap size, switching to CMS and increasing the number of CPU cores (thus GC threads) can have a large effect BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 52. 3. More Powerful Hardware (RAM/CPU cores) • Assessment BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Pros Cons not much working effort to realize involved costs may only mask underlying problems until a later stage (e.g. increased load)
  • 53. 4. Distribute Memory Processing to multiple JVMs • Sometimes easy, sometimes harder • If we are talking about a mostly stateless application with a rather small amount of long lived objects horizontal scaling is quite easy (using proper loadbalancing and failover) • Long-lived data needs to be somehow partitioned/sharded in order to improve efficiency (either manually or by using products supporting distributed memory structures aka. DataGrids – like Hazelcast, Infinispan, Terracotta, GridGain, Coherence etc.) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 54. 4. Distribute Memory Processing to multiple JVMs • Assessment BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Pros Cons depending on nature of application Java heap usage per instance can be drastically reduced if existing application, distribution may need some re-architecture if memory issues are the only reason to massively scale horizontally one shouldn‘t forget about increased complexity, operational overhead and total memory overhead
  • 55. 5. Custom Off-Heap Memory Management (1) • sun.misc.Unsafe (internal implementation, dangerous, non-portable, and volatile) • java.nio.ByteBuffer#allocateDirect (since JDK 1.4) • Maximum size to be set with –XX:MaxDirectMemorySize= • You have to use some serialization/deserialization mechanism • Java‘s default serialization/deserialization is not very fast • Two sub strategies: – Dynamic size and merging: no memory wasted, but suffers fragmentation (synchronization at allocation/deallocation) – Fixed size buffer allocation: no fragmentation, but memory wasted • Proper cleanup not quite elegant to achieve (relies on finalizer ) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 56. 5. Custom Off-Heap Memory Management (2) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture static { Method directBufferCleanerX = null; Method directBufferCleanerCleanX = null; boolean v; try { directBufferCleanerX = Class.forName("java.nio.DirectByteBuffer").getMethod("cleaner"); directBufferCleanerX.setAccessible(true); directBufferCleanerCleanX = Class.forName("sun.misc.Cleaner").getMethod("clean"); directBufferCleanerCleanX.setAccessible(true); v = true; } catch (Exception e) { v = false; } CLEAN_SUPPORTED = v; directBufferCleaner = directBufferCleanerX; directBufferCleanerClean = directBufferCleanerCleanX; } Lucene/Elastic Search Code: within inner class in interface org.apache.lucene.store. bytebuffer.ByteBufferAllocator forked to other projects like JBoss Netty
  • 57. Custom Off-Heap Memory Management (3) • Projects and products using this strategy: – Oracle Coherence – GigaSpaces, (to be validated) – Hazelcast (Enterprise Edition) – GridGain – Terracotta BigMemory – Lucene / Elastic Search • Open Frameworks to use this strategy – Apache DirectMemory (Serialization via Protostuff) – FST - Fast Serialization BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 58. 5. Custom Off-Heap Memory Management (4) • Assessment: BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Pros Cons can reduce GC overhead / max pause times quite tricky to get right, extreme implementations end up in own GC „useful“ usage limited to simple/flat data structures (key-value) access; usage as medium speed tier in Caches off-heap allocation is a lot slower than on Java-heap allocatoin either memory waste or fragmentation standard heap analysis tooling does not apply, second set of tooling required
  • 59. 6. JVM with more efficient Memory Management (1) The Ultimate JVM GC Tuning Guide java -Xmx40g ZING BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 60. 6. JVM with more efficient Memory Management (2) • Azul Zing Practical Evaluation / Comparison against Oracle HotSpot JVM • Preparation: – selected real software system as part of our platform showing some GC issues in production – setup test environment (single JVM instance) on VM with 16 GB, 8 cores – created load test using real data captured from live systems – single test run designed to last about one and a half hours • Test Conduction: – incrementally increased load (concurrent users) until Oracle Hotspot with some default memory configuration showing severe issues – changed memory sizing as well as GC algorithm in order to demonstrate issues known from real live – switched to untuned Azul Zing BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 61. 6. JVM with more efficient Memory Management (3) • Oracle HotSpot 1.6.0_43-b01, 64bit – 1 GB MaxHeap - ParallelGC: -Xms768m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 62. 6. JVM with more efficient Memory Management (4) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Oracle HotSpot 1.6.0_43-b01, 64bit – 1 GB MaxHeap - ParallelGC:
  • 63. 6. JVM with more efficient Memory Management (5) • Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, ParallelGC -Xms2048m –Xmx4096m -XX:PermSize=128m -XX:MaxPermSize=128m BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 64. 6. JVM with more efficient Memory Management (6) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, ParallelGC
  • 65. 6. JVM with more efficient Memory Management (7) • Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, CMS -Xms4096m -Xmx4096m -XX:+UseConcMarkSweepGC //PermGen unchanged BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 66. 6. JVM with more efficient Memory Management (8) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Oracle Hotspot 1.6.0_43-b01, 64bit – 4 GB MaxHeap, CMS
  • 67. 6. JVM with more efficient Memory Management (9) • Oracle Hotspot 1.6.0_43-b01, 64bit – 2 GB MaxHeap, CMS (tuned): -Xms2g -Xmx2g -Xmn256m -XX:SurvivorRatio=4 -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=16 -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly // PermGen unchanged BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 68. 6. JVM with more efficient Memory Management (10) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Oracle Hotspot 1.6.0_43-b01, 64bit – 2 GB MaxHeap, CMS (tuned):
  • 69. 6. JVM with more efficient Memory Management (11) • Azul Zing 1.6.0_33-ZVM_5.5.3.0-b5, 64bit – 10 GB MaxHeap, C4: -Xmx10g BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 70. 6. JVM with more efficient Memory Management (12) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Azul Zing 1.6.0_33-ZVM_5.5.3.0-b5, 64bit – 10 GB MaxHeap, C4
  • 71. 6. JVM with more efficient Memory Management (12) • The efficiency of memory and thread management is up to each JVM implementation • Azul Systems offers an highly optimized commercial JVM called Zing which is designed for low latency use with large (multi-GB heaps: 1 – > 300 GB) • It uses a special read barrier (Loaded Value Barrier) to support concurrent compaction, concurrent remapping, and concurrent incremental update tracing • Zing uses Generational GC, but the same base algorithm for both young and old gen: C4 (Continuously Concurrent Compacting Collector (C4) • Zing is built on top of a proprietary Loadable Linux Kernel Module (multiple Linux distributions supported: RedHat, CentOs, SLES, Ubuntu, etc.) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 72. 6. JVM with more efficient Memory Management (13) • Comparison of peak mremap rates for 16 GB of remaps • Zing has a custom memory and thread management implementation and adds a production monitoring and management platform BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Active Threads Stock Linux Modified Linux Speedup 0 43.58 GB/sec (360ms) 4734.85 TB/sec (3us) >100,000x 1 3.04 GB/sec (5s) 1488.10 TB/sec (11us) >480,000x 2 1.82 GB/sec (8s) 1166.04 TB/sec (14us) >640,000x 4 1.19 GB/sec (13s) 913.74 TB/sec (18us) >750,000x 8 897.65 MB/sec (18s) 801.28 TB/sec (20us) >890,000x 12 736.65 MB/sec (21s) 740.52 TB/sec (22us) >1,000,000x [REF_07] C4: The Continuously Concurrent Compacting Collector
  • 73. 6. JVM with more efficient Memory Management (14) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture [REF_08] Understanding Zing LX Memory Use
  • 74. 6. JVM with more efficient Memory Management (15) • Assessment BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture Pros Cons incredibly low pause times not available in a free, unsupported form; license costs as with other supported JVMs no GC tuning required if not aiming for microsecond pause times requires Azul Linux Kernel Module (dependent on Linux distribution and Kernel ABI/signature change policy some update restrictions and increased operational effort possible) predictable worst case pause times requires more memory to work efficiently (reserved for Zing usage even if JVM is not running) supports multi-GB large heaps a delay in which features in the major Oracle Java Hotspot JVM releases are available in Zing, which is aimed to be further reduced in the future sophisticated monitoring in production (certain CPU requirements, but fulfilled by all modern commodity server CPUs)
  • 75. Future Perspectives (1) • Garbage Collection and performance on virtualized environments is among the hot future topics • Oracle currently busy with GC „convergence“ (merging sources of former Bea JRockit and Sun Hotspot JVMs and tooling), stabilization and performance improvements of G1 (future standard?, only one GC „framework“ instead of currently three) • General Goals according to talks to vendors like Oracle and IBM: – Solve linear scaling problem (200ms @ 1GB → 20s @ 100GB) (partly caused as result of deferring of “expensive operations”) – Scale using result-based, concurrent and incremental (through partitioned heap) garbage collection – More flexible utilization of hardware (different data stores, SSD etc.) BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 76. Future Perspectives (2) • No interest of Linux Kernel community to integrate Azul’s improvements (consequently they gave up on this) • Future will show to what extend Azul Systems will actively participate in the OpenJDK project and how this will influence upcoming Java SE versions • The gap between Azul Zing and all other JVM implementations in terms of memory model efficiency seems to be large and not likely to be closed anytime soon BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 77. Discussion / Questions BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 78. References • [REF_01] Systems Computing - Understanding CPU Caching and Performance by Jon "Hannibal" Stokes • [REF_02] Death By Pauses - Devoxx France 2012 by Frank Pavageau • [REF_03] Memory Management in the Java HotSpot Virtual Machine by Sun Microsystems • [REF_04] Java Reference Objects by Keith D. Gregory • [REF_05] The Art of Garbage Collection Tuning by Angelika Langer & Klaus Kreft • [REF_06] Java7 Garbage Collector G1 by Antons Kranga • [REF_07] C4: The Continuously Concurrent Compacting Collector by Azul Systems (Gil Tene, Balaji Iyengar, Michael Wolf • [REF_08] Understanding Zing LX Memory Use by Azul Systems BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture
  • 79. Further Reading • Official Oracle JVM options documentation (subset) • Official Oracle JVM GC Tuning Documentation • Java Garbage Collection Analysis and Tuning • JavaOne 2012 - Gil Tene - Azul Systems - Understanding GC • Alexey Ragozin - HotSpot JVM GC Options Cheat Sheet (v2) • Alexey Ragozin - Understanding GC pauses in JVM, HotSpot's minor GC • Alexey Ragozin - Understanding GC pauses in JVM, HotSpot's CMS collector • Alexey Ragozin - Surviving 16GiB heap and greater • Java OutOfMemoryError – Eine Tragödie in sieben Akten • JavaOne 2012 - G1 Garbage Collector Tuning • How to Monitor Java Garbage Collection | CUBRID Blog • Everything I ever learned about jvm performance tuning (twitter) • Displaying Java’s Memory Pool Statistics with VisualVM BERLIN, May 22. 2013 | Eric Hubert - Strategy & Architecture