SlideShare a Scribd company logo
Memory Management
What You Need To Know When Moving to Java 8
Todd Rader, Architect / Sales Engineer
AppDynamics
Market Leadership
175% Bookings
Growth 2013
1000+
Customers
OUR
PLATFORM
Website
download
Rapid
Time to Value
Low cost of
ownership
$
Enterprise
adoption
Scalable -
largest APM
deployments
On-Premise,
SaaS, Hybrid
No professional
Services
84
Net Promoter Score
OUR
APPDYNAMICS
Copyright © 2014 AppDynamics. All rights reserved. 2
Agenda
• Memory Basics
• …with a dive into metaspace
• Fun With Garbage Collectors
• GC bake-off
• Summary/Conclusions
• Q&A
Copyright © 2014 AppDynamics. All rights reserved. 3
Memory Basics: Types of Memory
STACK
• Each thread has its own call stack
• Adjust with -Xss
• 64-bit JVMs need more stack size (8-byte references)
• Default stack size: ????
Java7, jdk1.7.0_51, 64-bit on MacOS 10.9.6
• Call depth before StackOverflowError: 10,827 (consistently)
Java8, jdk1.8.0_05, 64-bit on MacOS 10.9.6
• Call depth before StackOverflowError: 20,000-ish (huh?)
Copyright © 2014 AppDynamics. All rights reserved. 4

Recommended for you

Formation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-dataFormation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-data

Une riche présentation de Mapping Objet Relationnel qui traite le standard JPA et l’implémentation Hibernate en les intégrant avec le frammework IOC spring.

spring jpajpahibernate jpa
java memory management & gc
java memory management & gcjava memory management & gc
java memory management & gc

The document discusses Java memory management and garbage collection. It describes the responsibilities of garbage collection as allocating memory, ensuring referenced objects remain in memory, and recovering memory from unreachable objects. It discusses generation collection and the Hotspot memory model with young and old generations. The major garbage collectors are described as serial, parallel, parallel compacting, and concurrent mark-sweep collectors. The document provides examples of VM options and logging output.

java gc memory management
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming

Here I discuss about Java programming language and easiest way to solve programming problem. Java basic syntax and their uses are described briefly so that anyone can easily understand within very short time. If anyone follow the slide with proper way,I assure that he or she will find java programming interesting.

jdkjvmpolymorphism
Stack (cont’d)
FUN WITH NUMBERS….
• With Java8 default stack size, call depth = 20,000-ish
• Using –Xss1024k, same result (SO: default –Xss=1024k)
• Using –XX:ThreadStackSize=1024, same result (-
XX:ThreadStackSize is another way of expressing –Xss)
Okay, but…
• -Xss512k result: 9000-ish
• Not quite linear!
Need more memory space? Use a smaller –Xss value!
• 200 threads * 512kb/thread = 100 MB saved!
• What is your true stack size requirement?
Copyright © 2014 AppDynamics. All rights reserved. 5
Memory Basics: Types of Memory (cont’d)
HEAP
• Eden/New vs. Survivor vs. Old/Tenured
• “Ideal Object Death Rate”
• Eden >> Old >> Survivor
Copyright © 2014 AppDynamics. All rights reserved. 6
Heap (cont’d)
HEAP
• What is your object survival demography?
• Caching!
• Find out with:
• -XX:+PrintGCDetails
• -XX:+PrintTenuringDistribution
• -XX:+PrintGCTimestamps
• Adjust with:
• -XX:NewRatio=n
– Example: NewRatio=2  (oldGenSize) = 2 * (newGenSize)
• -XX:NewSize=n (minimum)
• -XX:MaxNewSize=n
• -XX:MinFreeHeapRatio=n
• -XX:MaxFreeHeapRatio=n
Copyright © 2014 AppDynamics. All rights reserved. 7
Heap: Java 6 HotSpot
Copyright © 2014 AppDynamics. All rights reserved. 8

Recommended for you

Jvm Architecture
Jvm ArchitectureJvm Architecture
Jvm Architecture

This document discusses Java garbage collection. It describes the serial, parallel, and concurrent collectors. The serial collector uses one thread for garbage collection while the parallel collector performs minor collections in parallel. Concurrent collectors like CMS and G1 perform most work concurrently to minimize pauses. The document also discusses selecting collectors based on data size, performance priorities, and pause time requirements. It notes young generation collectors like Copy and PS Scavenge as well as old generation collectors like MarkSweepCompact and ConcurrentMarkSweep.

jvmgcgarbage collectors
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...

The very best attackers often use PowerShell to hide their scripts from A/V and application whitelisting technologies using encoded commands and memory-only payloads to evade detection. These techniques thwart Blue Teams from determining what was executed on a target system. However, defenders are catching on, and state-of-the-art detection tools now monitor the command line arguments for powershell.exe either in real-time or from event logs. We need new avenues to remain stealthy in a target environment. So, this talk will highlight a dozen never-before-seen techniques for obfuscating PowerShell command line arguments. As an incident responder at Mandiant, I have seen attackers use a handful of these methods to evade basic command line detection mechanisms. I will share these techniques already being used in the wild so you can understand the value each technique provides the attacker. Updated PowerShell event logging mitigates many of the detection challenges that obfuscation introduces. However, many organizations do not enable this PowerShell logging. Therefore, I will provide techniques that the Blue Team can use to detect the presence of these obfuscation methods in command line arguments. I will conclude this talk by highlighting the public release of Invoke-Obfuscation. This tool applies the aforementioned obfuscation techniques to user-provided commands and scripts to evade command line argument detection mechanisms. --- Daniel Bohannon Daniel Bohannon is an Incident Response Consultant at MANDIANT with over six years of operations and information security experience. His particular areas of expertise include enterprise-wide incident response investigations, host-based security monitoring, data aggregation and anomaly detection, and PowerShell-based attack research and detection techniques. As an incident response consultant, Mr. Bohannon provides emergency services to clients when security breach occur. He also develops new methods for detecting malicious PowerShell usage at both the host- and network-level while researching obfuscation techniques for PowerShell- based attacks that are being used by numerous threat groups. Prior to joining MANDIANT, Mr. Bohannon spent five years working in both IT operations and information security roles in the private retail industry. There he developed operational processes for the automated aggregation and detection of host- and network-based anomalies in a large PCI environment. Mr. Bohannon also programmed numerous tools for host-based hunting while leading the organization’s incident response team. Mr. Bohannon received a Master of Science in Information Security from the Georgia Institute of Technology and a Bachelor of Science in Computer Science from The University of Georgia.

obfuscationmonitor attackers activitycode blue
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS

This document introduces ReactJS, a JavaScript library for building user interfaces. It discusses key React concepts like the virtual DOM, which is a JavaScript representation of real DOM elements that allows React to efficiently update the real DOM by comparing it to a new virtual DOM. It also covers one-way data binding in React, where data flows from parent to child components through props, while events flow in the opposite direction. Finally, it emphasizes that in React, everything is a component, and components manage their own state and receive immutable props from parent components.

Memory Basics: Types of Memory (cont’d)
META
• PermGen in Java 6
• PermGen (sort of) in Java 7
• Metaspace in Java 8
while (true) {
int length = rnd.nextInt(100);
StringBuilder builder = new StringBuilder();
String chars = "abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < length; i++) {
builder.append(chars.charAt(rnd.nextInt(chars.length())));
}
interned.add(builder.toString().intern());
}
What happens when this code is run?
Copyright © 2014 AppDynamics. All rights reserved. 9
Running the code…
JAVA 6
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
• …in about 8 seconds!
JAVA 7
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
• …and it takes a long time to happen!
JAVA 8
• Similar result as with Java 7
Copyright © 2014 AppDynamics. All rights reserved. 10
What happened???
JAVA 6
PermGen contains:
• Class meta data
• Interned strings
JAVA 7
• Interned strings moved to Metaspace
JAVA 8
• Class meta data also moved to Metaspace
Copyright © 2014 AppDynamics. All rights reserved. 11
Metaspace
REPLACEMENT FOR PERMGEN
• NOT JVM memory – native memory!
• BEA/Oracle JRockit
• IBM JVM
SOME NEW STARTUP FLAGS
• -XX:MetaSpaceSize=n (initial size)
• -XX:MaxMetaSpaceSize=n
• -XX:MaxMetaspaceExpansion=n
• -XX:MaxMetaspaceFreeRatio=n
• No default values for size! Max metaspace size is unlimited :-0
• Say goodbye to PermGen problems……right? Right?
Copyright © 2014 AppDynamics. All rights reserved. 12

Recommended for you

Performance Engineering Masterclass: Introduction to Modern Performance
Performance Engineering Masterclass: Introduction to Modern PerformancePerformance Engineering Masterclass: Introduction to Modern Performance
Performance Engineering Masterclass: Introduction to Modern Performance

Leandro Melendez from Grafana k6 starts off by providing a grounding in current expectations of what performance engineering and load testing entail. This session defines the modern challenges developers face, including continuous performance principles, Service Level Objectives (SLOs), and Service Level Indicators (SLIs). It delineates best practices and provides hands-on examples using Grafana k6, an open source modern load testing tool.

scylladbscyllanosql
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java

For years we’ve been told that the JVM’s amazing optimizers can take your running code and make it “fast” or “as fast as C++” or “as fast as C”…or sometimes “faster than C”. And yet we don’t often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world. In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.

assemblyjvmjit
Packages,static,this keyword in java
Packages,static,this keyword in javaPackages,static,this keyword in java
Packages,static,this keyword in java

This document summarizes key concepts about packages, classes, and the static keyword in Java. It discusses how packages are used to organize classes and prevent naming conflicts. It also explains that the static keyword in Java is used for memory management and that static variables, methods, blocks, and nested classes belong to the class rather than object instances. The document provides examples of how to define packages and use the static keyword with variables, methods, and blocks in Java programs.

javapackagesstatic
More Metaspace
OBSOLETES SOME OLD STARTUP FLAGS
• All of the “-XX:*Perm*” flags
NEW MEMORY POOL OBJECTS
• No more matching on “Perm” for pool name
Copyright © 2014 AppDynamics. All rights reserved. 13
What does this mean?
NO MORE OOM/PERMGEN
• But metaspace errors don’t go away 
• Monitor metaspace, not PermGen
• Use –XX:MaxMetaSpaceSize?
• No  you will never run out of metaspace
• …but your use of native memory can grow unbounded!
• Yes  you merely replace “OutOfMemory: PermGen space” with
“OutOfMemory: Metaspace”
MONITOR METASPACE
• Apps that leak metadata will still leak metadata
• Gobbling up metaspace affects the entire system, not just the JVM
• Remember: native memory!
Copyright © 2014 AppDynamics. All rights reserved. 14
Monitoring Metaspace
COMMERCIAL SOLUTIONS
• Expect (demand!) metaspace monitoring support to go along with
Java 8 support
JAVA MANAGEMENT BEANS
• Update any querying of MBeans to search for Metaspace memory
pool instead of PermGen pools.
JVISUALVM
• Metaspace monitoring supported
• …at least in the jvisualvm that is bundled with Jdk1.8.0_05 on MacOS!
Copyright © 2014 AppDynamics. All rights reserved. 15
Memory Basics: Types of Memory (cont’d)
DIRECT
• sun.misc.Unsafe
• Used by the JDK (nio classes, for example)
• Out of the scope of this talk!
Copyright © 2014 AppDynamics. All rights reserved. 16

Recommended for you

Clean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a MonolithClean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a Monolith

Talk built based on several of my trainings: http://www.victorrentea.ro/#training Covers: Clean/Onion/Hexagonal Architecture, Domain Entities, Value Objects, Repository, Extract When it Grows Principle, Dependency Inversion Principle, Clean Code and Design Patterns. These are the backing slides of the talks given at JPoint 2017 and Devoxx PL 2017: https://www.youtube.com/embed/4-4ahz7zDiQ

clean codeonion architecturedependency inversion principle
Java Garbage Collection - How it works
Java Garbage Collection - How it worksJava Garbage Collection - How it works
Java Garbage Collection - How it works

This session is all about - the mechanism provided by Java Virtual Machine to reclaim heap space from objects which are eligible for Garbage collection.

mindfiresolutionsjvmheap
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes

Java on Kubernetes may seem complicated, but after a bit of YAML and Dockerfiles, you will wonder what all that fuss was. But then the performance of your app in 1 CPU/1 GB of RAM makes you wonder. Learn how JVM ergonomics, CPU throttling, and GCs can help increase performance while reducing costs.

javajvmopenjdk
Let’s talk garbage…
PARALLEL GC
• Default on Java 7, Java 8
• ParNewGC is the default on Java 6
• Does parallel compaction in Java 6 and 7
• -XX:+UseParallelOldGC option in Java 5
CONCURRENT MARK AND SWEEP GC
• NOT compacting!
• Can be prone to fragmentation of old gen
•  very bad full GCs result
G1GC
• Only use after jdk1.7.0_u4!
• “Experimental” in previous releases
Copyright © 2014 AppDynamics. All rights reserved. 17
The GC Bake-off
GC KILLER PROGRAM
• Allocates lots of java.lang.Objects
• Allocates fewer long Strings
• Keeps objects around for varying lengths of times
• Checks heap memory availability
• When low, thousands of memory references are let go of
• No GC tuning options used
• 15-minute runs (killed with Ctrl-C)
• Java 7 vs. Java 8
Copyright © 2014 AppDynamics. All rights reserved. 18
Java 7, Parallel GC
Copyright © 2014 AppDynamics. All rights reserved. 19
Java 7, Parallel GC
HIGHLIGHTS
• No “-XX” option to enable (default)
• Heap usage varied between 1500-2750 MB
• Reasonable time spent in GC (1.6 seconds/minute)
• No major collections
Copyright © 2014 AppDynamics. All rights reserved. 20

Recommended for you

Maven
MavenMaven
Maven

The document discusses using Maven for automation builds. It covers quick starting a Maven project, the Maven lifecycle and phases, dependency and plugin management, and integrating Maven with IDEs like Eclipse. Key points include how to create a basic Maven project, the different Maven directories, common Maven commands, using the Surefire plugin to run tests, and configuring test dependencies.

webpack 101 slides
webpack 101 slideswebpack 101 slides
webpack 101 slides

Webpack is a module bundler that bundles JavaScript files for use in a browser. It takes modules with dependencies and generates static assets representing those modules. The key steps are to specify an entry point, add loaders for file transformations, specify the output bundle, and use plugins like html-webpack-plugin to generate HTML files that link to the bundled scripts. Webpack traverses dependency graphs to bundle assets in an optimized way.

JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps

This document provides an introduction to JUnit and Mockito for testing Java code. It discusses how to set up JUnit tests with annotations like @Before, @After, and @Test. It also covers using JUnit assertions and test suites. For Mockito, the document discusses how to create and use mock objects to stub behavior and verify interactions. It provides examples of argument matchers and consecutive stubbing in Mockito.

softwaregispom
Java 7, ConcMarkSweepGC
Copyright © 2014 AppDynamics. All rights reserved. 21
Java 7, ConcMarkSweepGC
HIGHLIGHTS
• Enabled with –XX:+UseConcMarkSweepGC
• Heap usage held steady around 2000 MB
• Huge amount of time spent in GC (24 seconds/minute!)
• No major collections
Copyright © 2014 AppDynamics. All rights reserved. 22
Java 7, G1GC
Copyright © 2014 AppDynamics. All rights reserved. 23
Java 7, G1GC
HIGHLIGHTS
• Enabled with –XX:+UseG1GC
• Heap usage varied between 750-2800 MB
• Very reasonable time spent in GC (0.6 seconds/minute)
• No major collections
Copyright © 2014 AppDynamics. All rights reserved. 24

Recommended for you

AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0

GraalVMs native-image ermöglicht es, JVM Bytecode direkt in Maschinencode zu übersetzen. Das daraus resultierende Executable benötigt keine JVM zum Laufen, startet schneller und verbraucht weniger Speicher als eine traditionelle JVM-Anwendung – ein Segen für Cloud Computing, bei dem jeder CPU-Cycle und Megabyte an RAM bezahlt werden muss. Wäre es nicht großartig, wenn unser Lieblingsframework, Spring Boot, GraalVM direkt out of the box unterstützen würde? In diesem Talk zeigt Moritz Halbritter, Spring Boot committer, was mit Spring Boot 3 und Spring Framework 6 alles möglich sein wird und erlaubt auch einen Blick unter die Motorhaube, um zu sehen, wie das alles implementiert ist.

spring nativegraalvmnative-image
Java I/O
Java I/OJava I/O
Java I/O

This document provides an overview of Java input/output (I/O) concepts including reading from and writing to the console, files, and streams. It discusses different I/O stream classes like PrintStream, InputStream, FileReader, FileWriter, BufferedReader, and how to read/write characters, bytes and objects in Java. The document also introduces new I/O features in Java 7 like try-with-resources for automatic resource management.

java
Tools for Metaspace
Tools for MetaspaceTools for Metaspace
Tools for Metaspace

This document discusses various tools for monitoring and analyzing metaspace and class metadata in the Java virtual machine. It describes using -XX:+PrintGCDetails to print details of full GC collections including metaspace usage. It also discusses using MBeans, jstat -gc, and VisualVM to monitor memory pools like metaspace and class space. The document further explains using jmap -clstats to view statistics per class loader and GC.class_stats to view statistics on Java class metadata, which both require unlocking diagnostic VM options.

java jjug
The winner for Java 7
G1!
• Less time spent in GC
• Heap usage max barely more than max using Parallel
• CMS max heap usage was only 2000
• CMS min was also near 2000 (very steady)
• Heap usage min best of all three
• No major collections
• BUT:
• Remember, no GC tuning parameters were used
• DO NOT USE G1GC before jdk1.7.0_04
• “Experimental” in prior releases
Copyright © 2014 AppDynamics. All rights reserved. 25
Java 8, Parallel GC
Copyright © 2014 AppDynamics. All rights reserved. 26
Java 8, Parallel GC
HIGHLIGHTS
• Incrementally worse than ParallelGC on Java 7
• Higher max heap (2950 vs. 2750)
• Higher min heap (1700MB vs. 1500MB)
• Roughly the same GC time (1.6 seconds/minute)
• No major collections
Copyright © 2014 AppDynamics. All rights reserved. 27
Java 8, ConcMarkSweepGC
Copyright © 2014 AppDynamics. All rights reserved. 28

Recommended for you

Java GC, Off-heap workshop
Java GC, Off-heap workshopJava GC, Off-heap workshop
Java GC, Off-heap workshop

The workshop is based on several Nikita Salnikov-Tarnovski lectures + my own research. The workshop consists of 2 parts. The first part covers: - different Java GCs, their main features, advantages and disadvantages; - principles of GC tuning; - work with GC Viewer as tool for GC analysis; - first steps tuning demo; - comparison primary GCs on Java 1.7 and Java 1.8 The second part covers: - work with Off-Heap: ByteBuffer / Direct ByteBuffer / Unsafe / MapDB; - examples and comparison of approaches; The off-heap-demo: https://github.com/moisieienko-valerii/off-heap-demo

java
The Java Memory Model
The Java Memory ModelThe Java Memory Model
The Java Memory Model

The Java Memory Model defines rules for how threads interact through shared memory in Java. It specifies rules for atomicity, ordering, and visibility of memory operations. The JMM provides guarantees for code safety while allowing compiler optimizations. It defines a happens-before ordering of instructions. The ordering rules and visibility rules ensure threads see updates from other threads as expected. The JMM implementation inserts memory barriers as needed to maintain the rules on different hardware platforms.

Java 8 Launch - MetaSpaces
Java 8 Launch - MetaSpacesJava 8 Launch - MetaSpaces
Java 8 Launch - MetaSpaces

This document discusses Java memory monitoring and tuning. It begins by describing the major memory regions in Java including heap, non-heap, code cache and permanent generation. It then discusses monitoring tools like JConsole and JStat. A significant portion discusses changes in Java 8 where the permanent generation was removed and replaced with metaspaces, which are more efficient and no longer cause full garbage collection pauses. The document concludes with examples of metaspace configuration options and monitoring commands.

java permgen metaspaces jdk8
Java 8, ConcMarkSweepGC
HIGHLIGHTS
• Just……lousy
• HUGE amount of initial time spent in gc
• 55 seconds/minute!
• Heap usage steadily declined
• From 3000MB to 2000MB
• With all that time spent, you’d think a major collection would be
avoided
• You’d be wrong 
• The only run with a major collection
Copyright © 2014 AppDynamics. All rights reserved. 29
Java 8, G1GC
Copyright © 2014 AppDynamics. All rights reserved. 30
Java 8, G1GC
HIGHLIGHTS
• Incrementally worse than G1/Java 7
• Heap usage max 2850MB vs. 2800MB
• GC time .8 seconds/minute vs. .6 seconds/minute
• No major collections
Copyright © 2014 AppDynamics. All rights reserved. 31
The winner for Java 8, and overall
G1 AGAIN!
• CMS not even close
• G1 on Java 7 overall winner
• Caveats:
• No GC tuning parameters used
• Heap-only: very little metadata memory used
• MacOS 10.9.4 (Maverick’s)
• 2.8 GHz Intel Core i7 processor
• 16 GB 1600 MHz memory
• Java 7: jdk 1.7.0_51 for MacOS
• Java 8: jdk 1.8.0_05 for MacOS
Copyright © 2014 AppDynamics. All rights reserved. 32

Recommended for you

ClassLoader Leaks
ClassLoader LeaksClassLoader Leaks
ClassLoader Leaks

Are you tired of java.lang.OutOfMemoryError: PermGen space? Then this talk is for you! We'll begin with a crash course in the Java memory model in order to understand what the error message means. Then we'll look at different causes of the error and how to avoid them. We may glance at a few interesting mistakes from the Open Source world. Last but not least you'll learn how you can get rid of java.lang.OutOfMemoryError: PermGen space once and for all.

classloaderpermgenleaks
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM

While most bugs reveal their cause within their stack trace, Java’s OutOfMemoryError is less talkative and therefore regarded as being difficult to debug by a majority of developers. With the right techniques and tools, memory leaks in Java programs can however be tackled like any other programming error. This talks discusses how a JVM stores data, categorizes different types of memory leaks that can occur in a Java program and presents techniques for fixing such errors. Furthermore, we will have a closer look at lambda expressions and their considerable potential of introducing memory leaks when they are used incautiously.

javamemoryjvm
Native Memory Tracking
Native Memory TrackingNative Memory Tracking
Native Memory Tracking

HotSpot 7u40 で導入されたNative Memory Tracking機能についてです。

#jjug#java
GC Tuning
OUT OF SCOPE 
• 600+ “-XX:” options
• 83 for CMS in Java 7
• 82 for CMS in Java 8
• No love for CMSTriggerPermRatio!
• 24 for G1 in Java 7 and 8
• Too many to cover!
Copyright © 2014 AppDynamics. All rights reserved. 33
Summary
• Know your object demography
• Monitor your metaspace
• Interned strings
• Class metadata
• Research the best GC
• Watch out for outdated information
• G1GC tests before jdk1.7.0_04
• Re-think CMS GC?
• Un-tuned CMS results far worse
Copyright © 2014 AppDynamics. All rights reserved. 34
FREE trial available:
www.appdynamics.com
Thank you

Recommended for you

Java memory model
Java memory modelJava memory model
Java memory model

This document discusses the Java Memory Model (JMM) and how it describes how threads interact through memory in Java. It covers key aspects of the JMM including happens-before ordering, memory barriers, visibility rules, and how final fields and atomic instructions interact with the memory model. It also discusses performance considerations and how different processor architectures implement memory ordering.

javaatomicjava memory model
Java memory presentation
Java memory presentationJava memory presentation
Java memory presentation

The document discusses various aspects of Java memory usage and garbage collection. It describes the Java heap structure, including the young generation, old generation, and survivor spaces. It also discusses object header information, memory addressing, and the impact of architecture (32-bit vs 64-bit) and JVM vendor (Oracle vs IBM) on object sizes. The garbage collection process of marking, sweeping, and compacting is explained.

memoryjava
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data

The document discusses tuning Java for large data workloads. It covers symptoms of memory issues like jobs getting stuck or failing. It then discusses various Java and Hadoop configuration settings to optimize memory usage like mapreduce.child.java.opts and mapreduce.map.memory.mb. Finally, it provides an overview of different garbage collectors in Java and factors like generation sizes and concurrent marking that impact performance.

More Related Content

What's hot

JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management Details
Azul Systems Inc.
 
Mocking in Java with Mockito
Mocking in Java with MockitoMocking in Java with Mockito
Mocking in Java with Mockito
Richard Paul
 
Improving app performance with Kotlin Coroutines
Improving app performance with Kotlin CoroutinesImproving app performance with Kotlin Coroutines
Improving app performance with Kotlin Coroutines
Hassan Abid
 
Formation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-dataFormation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-data
Lhouceine OUHAMZA
 
java memory management & gc
java memory management & gcjava memory management & gc
java memory management & gc
exsuns
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
Math-Circle
 
Jvm Architecture
Jvm ArchitectureJvm Architecture
Jvm Architecture
ThirupathiReddy Vajjala
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
CODE BLUE
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Hoang Long
 
Performance Engineering Masterclass: Introduction to Modern Performance
Performance Engineering Masterclass: Introduction to Modern PerformancePerformance Engineering Masterclass: Introduction to Modern Performance
Performance Engineering Masterclass: Introduction to Modern Performance
ScyllaDB
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
Charles Nutter
 
Packages,static,this keyword in java
Packages,static,this keyword in javaPackages,static,this keyword in java
Packages,static,this keyword in java
Vishnu Suresh
 
Clean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a MonolithClean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a Monolith
Victor Rentea
 
Java Garbage Collection - How it works
Java Garbage Collection - How it worksJava Garbage Collection - How it works
Java Garbage Collection - How it works
Mindfire Solutions
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
Bruno Borges
 
Maven
MavenMaven
webpack 101 slides
webpack 101 slideswebpack 101 slides
webpack 101 slides
mattysmith
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
Renato Primavera
 
AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0
MoritzHalbritter
 
Java I/O
Java I/OJava I/O

What's hot (20)

JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management Details
 
Mocking in Java with Mockito
Mocking in Java with MockitoMocking in Java with Mockito
Mocking in Java with Mockito
 
Improving app performance with Kotlin Coroutines
Improving app performance with Kotlin CoroutinesImproving app performance with Kotlin Coroutines
Improving app performance with Kotlin Coroutines
 
Formation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-dataFormation jpa-hibernate-spring-data
Formation jpa-hibernate-spring-data
 
java memory management & gc
java memory management & gcjava memory management & gc
java memory management & gc
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
Jvm Architecture
Jvm ArchitectureJvm Architecture
Jvm Architecture
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Performance Engineering Masterclass: Introduction to Modern Performance
Performance Engineering Masterclass: Introduction to Modern PerformancePerformance Engineering Masterclass: Introduction to Modern Performance
Performance Engineering Masterclass: Introduction to Modern Performance
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
Packages,static,this keyword in java
Packages,static,this keyword in javaPackages,static,this keyword in java
Packages,static,this keyword in java
 
Clean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a MonolithClean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a Monolith
 
Java Garbage Collection - How it works
Java Garbage Collection - How it worksJava Garbage Collection - How it works
Java Garbage Collection - How it works
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
Maven
MavenMaven
Maven
 
webpack 101 slides
webpack 101 slideswebpack 101 slides
webpack 101 slides
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
 
AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0
 
Java I/O
Java I/OJava I/O
Java I/O
 

Viewers also liked

Tools for Metaspace
Tools for MetaspaceTools for Metaspace
Tools for Metaspace
Takahiro YAMADA
 
Java GC, Off-heap workshop
Java GC, Off-heap workshopJava GC, Off-heap workshop
Java GC, Off-heap workshop
Valerii Moisieienko
 
The Java Memory Model
The Java Memory ModelThe Java Memory Model
The Java Memory Model
CA Technologies
 
Java 8 Launch - MetaSpaces
Java 8 Launch - MetaSpacesJava 8 Launch - MetaSpaces
Java 8 Launch - MetaSpaces
Haim Yadid
 
ClassLoader Leaks
ClassLoader LeaksClassLoader Leaks
ClassLoader Leaks
Mattias Jiderhamn
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
Rafael Winterhalter
 
Native Memory Tracking
Native Memory TrackingNative Memory Tracking
Native Memory Tracking
Takahiro YAMADA
 
Java memory model
Java memory modelJava memory model
Java memory model
Michał Warecki
 
Java memory presentation
Java memory presentationJava memory presentation
Java memory presentation
Yury Bubnov
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data
Scott Seighman
 
On heap cache vs off-heap cache
On heap cache vs off-heap cacheOn heap cache vs off-heap cache
On heap cache vs off-heap cache
rgrebski
 
Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...
Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...
Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...
AppDynamics
 
App Dynamics
App DynamicsApp Dynamics
App Dynamics
Dealmaker Media
 
End User Monitoring with AppDynamics - AppSphere16
End User Monitoring with AppDynamics - AppSphere16End User Monitoring with AppDynamics - AppSphere16
End User Monitoring with AppDynamics - AppSphere16
AppDynamics
 
AppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete GuideAppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete Guide
Takipi
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)
Rudy De Busscher
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
Azul Systems, Inc.
 
Sms-Voting and Elections
Sms-Voting and ElectionsSms-Voting and Elections
Sms-Voting and Elections
SergeClause
 
Java 8 from perm gen to metaspace
Java 8  from perm gen to metaspaceJava 8  from perm gen to metaspace
Java 8 from perm gen to metaspace
Mohammad Faizan
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
Oleg Tsal-Tsalko
 

Viewers also liked (20)

Tools for Metaspace
Tools for MetaspaceTools for Metaspace
Tools for Metaspace
 
Java GC, Off-heap workshop
Java GC, Off-heap workshopJava GC, Off-heap workshop
Java GC, Off-heap workshop
 
The Java Memory Model
The Java Memory ModelThe Java Memory Model
The Java Memory Model
 
Java 8 Launch - MetaSpaces
Java 8 Launch - MetaSpacesJava 8 Launch - MetaSpaces
Java 8 Launch - MetaSpaces
 
ClassLoader Leaks
ClassLoader LeaksClassLoader Leaks
ClassLoader Leaks
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
 
Native Memory Tracking
Native Memory TrackingNative Memory Tracking
Native Memory Tracking
 
Java memory model
Java memory modelJava memory model
Java memory model
 
Java memory presentation
Java memory presentationJava memory presentation
Java memory presentation
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data
 
On heap cache vs off-heap cache
On heap cache vs off-heap cacheOn heap cache vs off-heap cache
On heap cache vs off-heap cache
 
Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...
Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...
Next-Gen Business Transaction Configuration, Instrumentation, and Java Perfor...
 
App Dynamics
App DynamicsApp Dynamics
App Dynamics
 
End User Monitoring with AppDynamics - AppSphere16
End User Monitoring with AppDynamics - AppSphere16End User Monitoring with AppDynamics - AppSphere16
End User Monitoring with AppDynamics - AppSphere16
 
AppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete GuideAppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete Guide
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
Sms-Voting and Elections
Sms-Voting and ElectionsSms-Voting and Elections
Sms-Voting and Elections
 
Java 8 from perm gen to metaspace
Java 8  from perm gen to metaspaceJava 8  from perm gen to metaspace
Java 8 from perm gen to metaspace
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 

Similar to Memory Management: What You Need to Know When Moving to Java 8

Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
Jamie Coleman
 
Simple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVM
Jamie Coleman
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
Mohammed Fazuluddin
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
Bruno Borges
 
Troubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed DebuggingTroubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed Debugging
Great Wide Open
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
Jean-Francois James
 
JITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfJITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdf
RichHagarty
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
Vladislav Gangan
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
graemerocher
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
InfinIT - Innovationsnetværket for it
 
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
James Anderson
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
Jeremy Leisy
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
Ender Aydin Orak
 
YARN
YARNYARN
Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019
Jamie Coleman
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
Poonam Bajaj Parhar
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
Eugene Lazutkin
 
JITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdfJITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdf
RichHagarty
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnostics
Danijel Mitar
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdf
RichHagarty
 

Similar to Memory Management: What You Need to Know When Moving to Java 8 (20)

Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
 
Simple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVM
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
 
Troubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed DebuggingTroubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed Debugging
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
 
JITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfJITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdf
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
 
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
GDG Cloud Southlake #20:Stefano Doni: Kubernetes performance tuning dilemma: ...
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
YARN
YARNYARN
YARN
 
Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
 
JITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdfJITServerTalk Nebraska 2023.pdf
JITServerTalk Nebraska 2023.pdf
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnostics
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdf
 

More from AppDynamics

Good Migrations: APM Essentials For Cloud Success at AppD Global Tour London
Good Migrations: APM Essentials For Cloud Success at AppD Global Tour LondonGood Migrations: APM Essentials For Cloud Success at AppD Global Tour London
Good Migrations: APM Essentials For Cloud Success at AppD Global Tour London
AppDynamics
 
Top Tips For AppD Adoption Success at AppD Global Tour London
Top Tips For AppD Adoption Success at AppD Global Tour LondonTop Tips For AppD Adoption Success at AppD Global Tour London
Top Tips For AppD Adoption Success at AppD Global Tour London
AppDynamics
 
How To Create An AppD Centre of Excellence at AppD Global Tour London
How To Create An AppD Centre of Excellence at AppD Global Tour LondonHow To Create An AppD Centre of Excellence at AppD Global Tour London
How To Create An AppD Centre of Excellence at AppD Global Tour London
AppDynamics
 
Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...
Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...
Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...
AppDynamics
 
Just Eat: DevOps at Scale at AppD Global Tour London
Just Eat: DevOps at Scale at AppD Global Tour LondonJust Eat: DevOps at Scale at AppD Global Tour London
Just Eat: DevOps at Scale at AppD Global Tour London
AppDynamics
 
What’s Next For AppDynamics and Cisco? AppD Global Tour London
What’s Next For AppDynamics and Cisco? AppD Global Tour LondonWhat’s Next For AppDynamics and Cisco? AppD Global Tour London
What’s Next For AppDynamics and Cisco? AppD Global Tour London
AppDynamics
 
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
AppDynamics
 
Overcoming Transformational Barriers with Ensono - AppD Global Tour London
Overcoming Transformational Barriers with Ensono - AppD Global Tour LondonOvercoming Transformational Barriers with Ensono - AppD Global Tour London
Overcoming Transformational Barriers with Ensono - AppD Global Tour London
AppDynamics
 
Equinor: What does normal look like?
Equinor: What does normal look like? Equinor: What does normal look like?
Equinor: What does normal look like?
AppDynamics
 
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
AppDynamics
 
Top Tips For AppD Adoption Success - AppD Global Tour Stockholm
Top Tips For AppD Adoption Success - AppD Global Tour StockholmTop Tips For AppD Adoption Success - AppD Global Tour Stockholm
Top Tips For AppD Adoption Success - AppD Global Tour Stockholm
AppDynamics
 
What's next for AppD and Cisco? - AppD Global Tour
What's next for AppD and Cisco? - AppD Global TourWhat's next for AppD and Cisco? - AppD Global Tour
What's next for AppD and Cisco? - AppD Global Tour
AppDynamics
 
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit EuropeCisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
AppDynamics
 
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
AppDynamics
 
Forrester Research: How To Organise Your Business For Digital Success - AppD ...
Forrester Research: How To Organise Your Business For Digital Success - AppD ...Forrester Research: How To Organise Your Business For Digital Success - AppD ...
Forrester Research: How To Organise Your Business For Digital Success - AppD ...
AppDynamics
 
Mastering APM With End User Monitoring - AppD Summit Europe
Mastering APM With End User Monitoring - AppD Summit EuropeMastering APM With End User Monitoring - AppD Summit Europe
Mastering APM With End User Monitoring - AppD Summit Europe
AppDynamics
 
Become an AppDynamics Dashboard Rockstar - AppD Summit Europe
Become an AppDynamics Dashboard Rockstar - AppD Summit EuropeBecome an AppDynamics Dashboard Rockstar - AppD Summit Europe
Become an AppDynamics Dashboard Rockstar - AppD Summit Europe
AppDynamics
 
Business iQ: What It Is and How to Start - AppD Summit Europe
Business iQ: What It Is and How to Start - AppD Summit EuropeBusiness iQ: What It Is and How to Start - AppD Summit Europe
Business iQ: What It Is and How to Start - AppD Summit Europe
AppDynamics
 
Containers: Give Me The Facts, Not The Hype - AppD Summit Europe
Containers: Give Me The Facts, Not The Hype - AppD Summit EuropeContainers: Give Me The Facts, Not The Hype - AppD Summit Europe
Containers: Give Me The Facts, Not The Hype - AppD Summit Europe
AppDynamics
 
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit EuropeAutomation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
AppDynamics
 

More from AppDynamics (20)

Good Migrations: APM Essentials For Cloud Success at AppD Global Tour London
Good Migrations: APM Essentials For Cloud Success at AppD Global Tour LondonGood Migrations: APM Essentials For Cloud Success at AppD Global Tour London
Good Migrations: APM Essentials For Cloud Success at AppD Global Tour London
 
Top Tips For AppD Adoption Success at AppD Global Tour London
Top Tips For AppD Adoption Success at AppD Global Tour LondonTop Tips For AppD Adoption Success at AppD Global Tour London
Top Tips For AppD Adoption Success at AppD Global Tour London
 
How To Create An AppD Centre of Excellence at AppD Global Tour London
How To Create An AppD Centre of Excellence at AppD Global Tour LondonHow To Create An AppD Centre of Excellence at AppD Global Tour London
How To Create An AppD Centre of Excellence at AppD Global Tour London
 
Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...
Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...
Ensure Every Customer Matters With End User Monitoring at AppD Global Tour Lo...
 
Just Eat: DevOps at Scale at AppD Global Tour London
Just Eat: DevOps at Scale at AppD Global Tour LondonJust Eat: DevOps at Scale at AppD Global Tour London
Just Eat: DevOps at Scale at AppD Global Tour London
 
What’s Next For AppDynamics and Cisco? AppD Global Tour London
What’s Next For AppDynamics and Cisco? AppD Global Tour LondonWhat’s Next For AppDynamics and Cisco? AppD Global Tour London
What’s Next For AppDynamics and Cisco? AppD Global Tour London
 
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
 
Overcoming Transformational Barriers with Ensono - AppD Global Tour London
Overcoming Transformational Barriers with Ensono - AppD Global Tour LondonOvercoming Transformational Barriers with Ensono - AppD Global Tour London
Overcoming Transformational Barriers with Ensono - AppD Global Tour London
 
Equinor: What does normal look like?
Equinor: What does normal look like? Equinor: What does normal look like?
Equinor: What does normal look like?
 
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
Unlock The Power Of Real-Time Performance Data With Business iQ - AppD Global...
 
Top Tips For AppD Adoption Success - AppD Global Tour Stockholm
Top Tips For AppD Adoption Success - AppD Global Tour StockholmTop Tips For AppD Adoption Success - AppD Global Tour Stockholm
Top Tips For AppD Adoption Success - AppD Global Tour Stockholm
 
What's next for AppD and Cisco? - AppD Global Tour
What's next for AppD and Cisco? - AppD Global TourWhat's next for AppD and Cisco? - AppD Global Tour
What's next for AppD and Cisco? - AppD Global Tour
 
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit EuropeCisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
 
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
 
Forrester Research: How To Organise Your Business For Digital Success - AppD ...
Forrester Research: How To Organise Your Business For Digital Success - AppD ...Forrester Research: How To Organise Your Business For Digital Success - AppD ...
Forrester Research: How To Organise Your Business For Digital Success - AppD ...
 
Mastering APM With End User Monitoring - AppD Summit Europe
Mastering APM With End User Monitoring - AppD Summit EuropeMastering APM With End User Monitoring - AppD Summit Europe
Mastering APM With End User Monitoring - AppD Summit Europe
 
Become an AppDynamics Dashboard Rockstar - AppD Summit Europe
Become an AppDynamics Dashboard Rockstar - AppD Summit EuropeBecome an AppDynamics Dashboard Rockstar - AppD Summit Europe
Become an AppDynamics Dashboard Rockstar - AppD Summit Europe
 
Business iQ: What It Is and How to Start - AppD Summit Europe
Business iQ: What It Is and How to Start - AppD Summit EuropeBusiness iQ: What It Is and How to Start - AppD Summit Europe
Business iQ: What It Is and How to Start - AppD Summit Europe
 
Containers: Give Me The Facts, Not The Hype - AppD Summit Europe
Containers: Give Me The Facts, Not The Hype - AppD Summit EuropeContainers: Give Me The Facts, Not The Hype - AppD Summit Europe
Containers: Give Me The Facts, Not The Hype - AppD Summit Europe
 
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit EuropeAutomation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
 

Recently uploaded

WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
MVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptxMVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptx
Mitchell Marsh
 
Overview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptxOverview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptx
Mitchell Marsh
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
908dutch
 
Attendance Tracking From Paper To Digital
Attendance Tracking From Paper To DigitalAttendance Tracking From Paper To Digital
Attendance Tracking From Paper To Digital
Task Tracker
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Asher Sterkin
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
ThousandEyes
 
active-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptxactive-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptx
sudsdeep
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
DNUG e.V.
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
kalichargn70th171
 
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
avufu
 
ENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentationENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentation
sofiafernandezon
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
Ortus Solutions, Corp
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
TwisterTools
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
karim wahed
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
ssuser2b426d1
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
sudsdeep
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
sachin chaurasia
 
Leading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptxLeading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptx
taskroupseo
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
miso_uam
 

Recently uploaded (20)

WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
 
MVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptxMVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptx
 
Overview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptxOverview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptx
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
 
Attendance Tracking From Paper To Digital
Attendance Tracking From Paper To DigitalAttendance Tracking From Paper To Digital
Attendance Tracking From Paper To Digital
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
 
active-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptxactive-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptx
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
 
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
 
ENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentationENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentation
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
 
Leading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptxLeading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptx
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
 

Memory Management: What You Need to Know When Moving to Java 8

  • 1. Memory Management What You Need To Know When Moving to Java 8 Todd Rader, Architect / Sales Engineer AppDynamics
  • 2. Market Leadership 175% Bookings Growth 2013 1000+ Customers OUR PLATFORM Website download Rapid Time to Value Low cost of ownership $ Enterprise adoption Scalable - largest APM deployments On-Premise, SaaS, Hybrid No professional Services 84 Net Promoter Score OUR APPDYNAMICS Copyright © 2014 AppDynamics. All rights reserved. 2
  • 3. Agenda • Memory Basics • …with a dive into metaspace • Fun With Garbage Collectors • GC bake-off • Summary/Conclusions • Q&A Copyright © 2014 AppDynamics. All rights reserved. 3
  • 4. Memory Basics: Types of Memory STACK • Each thread has its own call stack • Adjust with -Xss • 64-bit JVMs need more stack size (8-byte references) • Default stack size: ???? Java7, jdk1.7.0_51, 64-bit on MacOS 10.9.6 • Call depth before StackOverflowError: 10,827 (consistently) Java8, jdk1.8.0_05, 64-bit on MacOS 10.9.6 • Call depth before StackOverflowError: 20,000-ish (huh?) Copyright © 2014 AppDynamics. All rights reserved. 4
  • 5. Stack (cont’d) FUN WITH NUMBERS…. • With Java8 default stack size, call depth = 20,000-ish • Using –Xss1024k, same result (SO: default –Xss=1024k) • Using –XX:ThreadStackSize=1024, same result (- XX:ThreadStackSize is another way of expressing –Xss) Okay, but… • -Xss512k result: 9000-ish • Not quite linear! Need more memory space? Use a smaller –Xss value! • 200 threads * 512kb/thread = 100 MB saved! • What is your true stack size requirement? Copyright © 2014 AppDynamics. All rights reserved. 5
  • 6. Memory Basics: Types of Memory (cont’d) HEAP • Eden/New vs. Survivor vs. Old/Tenured • “Ideal Object Death Rate” • Eden >> Old >> Survivor Copyright © 2014 AppDynamics. All rights reserved. 6
  • 7. Heap (cont’d) HEAP • What is your object survival demography? • Caching! • Find out with: • -XX:+PrintGCDetails • -XX:+PrintTenuringDistribution • -XX:+PrintGCTimestamps • Adjust with: • -XX:NewRatio=n – Example: NewRatio=2  (oldGenSize) = 2 * (newGenSize) • -XX:NewSize=n (minimum) • -XX:MaxNewSize=n • -XX:MinFreeHeapRatio=n • -XX:MaxFreeHeapRatio=n Copyright © 2014 AppDynamics. All rights reserved. 7
  • 8. Heap: Java 6 HotSpot Copyright © 2014 AppDynamics. All rights reserved. 8
  • 9. Memory Basics: Types of Memory (cont’d) META • PermGen in Java 6 • PermGen (sort of) in Java 7 • Metaspace in Java 8 while (true) { int length = rnd.nextInt(100); StringBuilder builder = new StringBuilder(); String chars = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < length; i++) { builder.append(chars.charAt(rnd.nextInt(chars.length()))); } interned.add(builder.toString().intern()); } What happens when this code is run? Copyright © 2014 AppDynamics. All rights reserved. 9
  • 10. Running the code… JAVA 6 Exception in thread "main" java.lang.OutOfMemoryError: PermGen space • …in about 8 seconds! JAVA 7 Exception in thread "main" java.lang.OutOfMemoryError: Java heap space • …and it takes a long time to happen! JAVA 8 • Similar result as with Java 7 Copyright © 2014 AppDynamics. All rights reserved. 10
  • 11. What happened??? JAVA 6 PermGen contains: • Class meta data • Interned strings JAVA 7 • Interned strings moved to Metaspace JAVA 8 • Class meta data also moved to Metaspace Copyright © 2014 AppDynamics. All rights reserved. 11
  • 12. Metaspace REPLACEMENT FOR PERMGEN • NOT JVM memory – native memory! • BEA/Oracle JRockit • IBM JVM SOME NEW STARTUP FLAGS • -XX:MetaSpaceSize=n (initial size) • -XX:MaxMetaSpaceSize=n • -XX:MaxMetaspaceExpansion=n • -XX:MaxMetaspaceFreeRatio=n • No default values for size! Max metaspace size is unlimited :-0 • Say goodbye to PermGen problems……right? Right? Copyright © 2014 AppDynamics. All rights reserved. 12
  • 13. More Metaspace OBSOLETES SOME OLD STARTUP FLAGS • All of the “-XX:*Perm*” flags NEW MEMORY POOL OBJECTS • No more matching on “Perm” for pool name Copyright © 2014 AppDynamics. All rights reserved. 13
  • 14. What does this mean? NO MORE OOM/PERMGEN • But metaspace errors don’t go away  • Monitor metaspace, not PermGen • Use –XX:MaxMetaSpaceSize? • No  you will never run out of metaspace • …but your use of native memory can grow unbounded! • Yes  you merely replace “OutOfMemory: PermGen space” with “OutOfMemory: Metaspace” MONITOR METASPACE • Apps that leak metadata will still leak metadata • Gobbling up metaspace affects the entire system, not just the JVM • Remember: native memory! Copyright © 2014 AppDynamics. All rights reserved. 14
  • 15. Monitoring Metaspace COMMERCIAL SOLUTIONS • Expect (demand!) metaspace monitoring support to go along with Java 8 support JAVA MANAGEMENT BEANS • Update any querying of MBeans to search for Metaspace memory pool instead of PermGen pools. JVISUALVM • Metaspace monitoring supported • …at least in the jvisualvm that is bundled with Jdk1.8.0_05 on MacOS! Copyright © 2014 AppDynamics. All rights reserved. 15
  • 16. Memory Basics: Types of Memory (cont’d) DIRECT • sun.misc.Unsafe • Used by the JDK (nio classes, for example) • Out of the scope of this talk! Copyright © 2014 AppDynamics. All rights reserved. 16
  • 17. Let’s talk garbage… PARALLEL GC • Default on Java 7, Java 8 • ParNewGC is the default on Java 6 • Does parallel compaction in Java 6 and 7 • -XX:+UseParallelOldGC option in Java 5 CONCURRENT MARK AND SWEEP GC • NOT compacting! • Can be prone to fragmentation of old gen •  very bad full GCs result G1GC • Only use after jdk1.7.0_u4! • “Experimental” in previous releases Copyright © 2014 AppDynamics. All rights reserved. 17
  • 18. The GC Bake-off GC KILLER PROGRAM • Allocates lots of java.lang.Objects • Allocates fewer long Strings • Keeps objects around for varying lengths of times • Checks heap memory availability • When low, thousands of memory references are let go of • No GC tuning options used • 15-minute runs (killed with Ctrl-C) • Java 7 vs. Java 8 Copyright © 2014 AppDynamics. All rights reserved. 18
  • 19. Java 7, Parallel GC Copyright © 2014 AppDynamics. All rights reserved. 19
  • 20. Java 7, Parallel GC HIGHLIGHTS • No “-XX” option to enable (default) • Heap usage varied between 1500-2750 MB • Reasonable time spent in GC (1.6 seconds/minute) • No major collections Copyright © 2014 AppDynamics. All rights reserved. 20
  • 21. Java 7, ConcMarkSweepGC Copyright © 2014 AppDynamics. All rights reserved. 21
  • 22. Java 7, ConcMarkSweepGC HIGHLIGHTS • Enabled with –XX:+UseConcMarkSweepGC • Heap usage held steady around 2000 MB • Huge amount of time spent in GC (24 seconds/minute!) • No major collections Copyright © 2014 AppDynamics. All rights reserved. 22
  • 23. Java 7, G1GC Copyright © 2014 AppDynamics. All rights reserved. 23
  • 24. Java 7, G1GC HIGHLIGHTS • Enabled with –XX:+UseG1GC • Heap usage varied between 750-2800 MB • Very reasonable time spent in GC (0.6 seconds/minute) • No major collections Copyright © 2014 AppDynamics. All rights reserved. 24
  • 25. The winner for Java 7 G1! • Less time spent in GC • Heap usage max barely more than max using Parallel • CMS max heap usage was only 2000 • CMS min was also near 2000 (very steady) • Heap usage min best of all three • No major collections • BUT: • Remember, no GC tuning parameters were used • DO NOT USE G1GC before jdk1.7.0_04 • “Experimental” in prior releases Copyright © 2014 AppDynamics. All rights reserved. 25
  • 26. Java 8, Parallel GC Copyright © 2014 AppDynamics. All rights reserved. 26
  • 27. Java 8, Parallel GC HIGHLIGHTS • Incrementally worse than ParallelGC on Java 7 • Higher max heap (2950 vs. 2750) • Higher min heap (1700MB vs. 1500MB) • Roughly the same GC time (1.6 seconds/minute) • No major collections Copyright © 2014 AppDynamics. All rights reserved. 27
  • 28. Java 8, ConcMarkSweepGC Copyright © 2014 AppDynamics. All rights reserved. 28
  • 29. Java 8, ConcMarkSweepGC HIGHLIGHTS • Just……lousy • HUGE amount of initial time spent in gc • 55 seconds/minute! • Heap usage steadily declined • From 3000MB to 2000MB • With all that time spent, you’d think a major collection would be avoided • You’d be wrong  • The only run with a major collection Copyright © 2014 AppDynamics. All rights reserved. 29
  • 30. Java 8, G1GC Copyright © 2014 AppDynamics. All rights reserved. 30
  • 31. Java 8, G1GC HIGHLIGHTS • Incrementally worse than G1/Java 7 • Heap usage max 2850MB vs. 2800MB • GC time .8 seconds/minute vs. .6 seconds/minute • No major collections Copyright © 2014 AppDynamics. All rights reserved. 31
  • 32. The winner for Java 8, and overall G1 AGAIN! • CMS not even close • G1 on Java 7 overall winner • Caveats: • No GC tuning parameters used • Heap-only: very little metadata memory used • MacOS 10.9.4 (Maverick’s) • 2.8 GHz Intel Core i7 processor • 16 GB 1600 MHz memory • Java 7: jdk 1.7.0_51 for MacOS • Java 8: jdk 1.8.0_05 for MacOS Copyright © 2014 AppDynamics. All rights reserved. 32
  • 33. GC Tuning OUT OF SCOPE  • 600+ “-XX:” options • 83 for CMS in Java 7 • 82 for CMS in Java 8 • No love for CMSTriggerPermRatio! • 24 for G1 in Java 7 and 8 • Too many to cover! Copyright © 2014 AppDynamics. All rights reserved. 33
  • 34. Summary • Know your object demography • Monitor your metaspace • Interned strings • Class metadata • Research the best GC • Watch out for outdated information • G1GC tests before jdk1.7.0_04 • Re-think CMS GC? • Un-tuned CMS results far worse Copyright © 2014 AppDynamics. All rights reserved. 34

Editor's Notes

  1. SLIDE3: Why AppDynamics? establish credibility through 3rd party validation Commitment to customer success Business and customer growth Describe our GTM model – ease of deployment, Enterprise grade, proven in the most demanding environments and high impact, fast   . 
  2. Quiz: what is the default Java stack size?
  3. Quiz: what is the default Java stack size? Point of slide: If you’ve ever had to manage stack size, don’t expect Java 8 behavior to be the same as Java 7 Note that you can’t directly get the stack trace depth, only the size.
  4. Any questions on stack memory?
  5. Question: how many modern apps have this object death rate? Question: what common technique completely changes this picture?
  6. Question: how many modern apps have this object death rate?
  7. Blast from the past – Java 6 HotSpot Summary: heap is basically the same in Java 6/7/8, but GC options change Any questions about heap?
  8. Ask if anybody is surprised by this, can explain this
  9. Mention performance impact if interned strings were a big source of PermGen use in Java 6 Ask about the logo
  10. Push on the “no max size” theme. What would happen if a program that leaked class metadata permgen in Java 6 were put onto Java 8? Can get old behavior with MaxMetaSpaceSize
  11. Story about how PermGen can affect monitoring tools Retransform -> app holds onto class/meta references (reflection object caching)
  12. A PermGen problem will be less frequent but more severe if it moves to being a metaspace problem
  13. Ask for any questions on memory before we switch to garbage collection
  14. Why 15-minute periods? – practical: time needed to tune program for proper rate of allocation plus doing all the runs for comparison.
  15. Tune the program:
  16. What are the group’s experiences? Any questions on Java 7 results, before we move onto Java 8?
  17. What do you think CMS looks like on Java 8 with no tuning options?
  18. Monitoring memory and JVM stats is only a tiny part of what AppD does