The document discusses garbage collection in the Java HotSpot virtual machine. It covers the basics of garbage collection theory, HotSpot's memory organization and different collectors. The presentation also discusses how to read and analyze GC logs to understand application performance and identify issues like memory leaks or premature promotion.
Stop the Guessing: Performance Methodologies for Production SystemsBrendan Gregg
Talk presented at Velocity 2013. Description: When faced with performance issues on complex production systems and distributed cloud environments, it can be difficult to know where to begin your analysis, or to spend much time on it when it isn’t your day job. This talk covers various methodologies, and anti-methodologies, for systems analysis, which serve as guidance for finding fruitful metrics from your current performance monitoring products. Such methodologies can help check all areas in an efficient manner, and find issues that can be easily overlooked, especially for virtualized environments which impose resource controls. Some of the tools and methodologies covered, including the USE Method, were developed by the speaker and have been used successfully in enterprise and cloud environments.
"Performance Analysis Methodologies", USENIX/LISA12, San Diego, 2012
Performance analysis methodologies provide guidance, save time, and can find issues that are otherwise overlooked. Example issues include hardware bus saturation, lock contention, recoverable device errors, kernel scheduling issues, and unnecessary workloads. The talk will focus on the USE Method: a simple strategy for all staff for performing a complete check of system performance health, identifying common bottlenecks and errors. Other analysis methods discussed include workload characterization, drill-down analysis, and latency analysis, with example applications from enterprise and cloud computing. Don’t just reach for tools—use a method!
Debugging Distributed Systems - Velocity Santa Clara 2016Donny Nadolny
Despite our best efforts, our systems fail. Sometimes it’s our fault—code that we wrote, bugs that we caused. But sometimes the fault is with systems that we have no direct control over. Distributed systems are hard. They are complicated, hard to understand, and very challenging to manage. But they are critical to modern software, and when they have problems, we need to fix them.
ZooKeeper is a very useful distributed system that is often used as a building block for other distributed systems like Kafka and Spark. It is used by PagerDuty for many critical systems, and for five months it failed a lot. Donny Nadolny looks at what it takes to debug a problem in a distributed system like ZooKeeper, walking attendees through the process of finding and fixing one cause of many of these failures. Donny explains how to use various tools to stress test the network, some intricate details of how ZooKeeper works, and possibly more than you will want to know about TCP, including an example of machines having a different view of the state of a TCP stream.
http://conferences.oreilly.com/velocity/devops-web-performance-ca/public/schedule/detail/50058
Josh Berkus
Most users know that PostgreSQL has a 23-year development history. But did you know that Postgres code is used for over a dozen other database systems? Thanks to our liberal licensing, many companies and open source projects over the years have taken the Postgres or PostgreSQL code, changed it, added things to it, and/or merged it into something else. Illustra, Truviso, Aster, Greenplum, and others have seen the value of Postgres not just as a database but as some darned good code they could use. We'll explore the lineage of these forks, and go into the details of some of the more interesting ones.
Stop the Guessing: Performance Methodologies for Production SystemsBrendan Gregg
Talk presented at Velocity 2013. Description: When faced with performance issues on complex production systems and distributed cloud environments, it can be difficult to know where to begin your analysis, or to spend much time on it when it isn’t your day job. This talk covers various methodologies, and anti-methodologies, for systems analysis, which serve as guidance for finding fruitful metrics from your current performance monitoring products. Such methodologies can help check all areas in an efficient manner, and find issues that can be easily overlooked, especially for virtualized environments which impose resource controls. Some of the tools and methodologies covered, including the USE Method, were developed by the speaker and have been used successfully in enterprise and cloud environments.
"Performance Analysis Methodologies", USENIX/LISA12, San Diego, 2012
Performance analysis methodologies provide guidance, save time, and can find issues that are otherwise overlooked. Example issues include hardware bus saturation, lock contention, recoverable device errors, kernel scheduling issues, and unnecessary workloads. The talk will focus on the USE Method: a simple strategy for all staff for performing a complete check of system performance health, identifying common bottlenecks and errors. Other analysis methods discussed include workload characterization, drill-down analysis, and latency analysis, with example applications from enterprise and cloud computing. Don’t just reach for tools—use a method!
Debugging Distributed Systems - Velocity Santa Clara 2016Donny Nadolny
Despite our best efforts, our systems fail. Sometimes it’s our fault—code that we wrote, bugs that we caused. But sometimes the fault is with systems that we have no direct control over. Distributed systems are hard. They are complicated, hard to understand, and very challenging to manage. But they are critical to modern software, and when they have problems, we need to fix them.
ZooKeeper is a very useful distributed system that is often used as a building block for other distributed systems like Kafka and Spark. It is used by PagerDuty for many critical systems, and for five months it failed a lot. Donny Nadolny looks at what it takes to debug a problem in a distributed system like ZooKeeper, walking attendees through the process of finding and fixing one cause of many of these failures. Donny explains how to use various tools to stress test the network, some intricate details of how ZooKeeper works, and possibly more than you will want to know about TCP, including an example of machines having a different view of the state of a TCP stream.
http://conferences.oreilly.com/velocity/devops-web-performance-ca/public/schedule/detail/50058
Josh Berkus
Most users know that PostgreSQL has a 23-year development history. But did you know that Postgres code is used for over a dozen other database systems? Thanks to our liberal licensing, many companies and open source projects over the years have taken the Postgres or PostgreSQL code, changed it, added things to it, and/or merged it into something else. Illustra, Truviso, Aster, Greenplum, and others have seen the value of Postgres not just as a database but as some darned good code they could use. We'll explore the lineage of these forks, and go into the details of some of the more interesting ones.
It is easy to monitor the performance of JVM if one knows how GC and Threads work in JVM. This presentation throws light on Collector types, HotSpot Collection Algorithms, Thread Monitoring, Method Profiling and Heap Profiling
For More information, refer to Java EE 7 performance tuning and optimization book:
The book is published by Packt Publishing:
http://www.packtpub.com/java-ee-7-performance-tuning-and-optimization/book
This is a talk I did for JavaOne 2009. The focus of the talk was memory management and system monitoring with freely available tools that are in the jdk or open source.
The main body of work related to supporting dynamic languages on the JVM at Oracle today is done within the Nashorn project. While on the surface it looks like we're busy creating a JavaScript runtime, in reality JavaScript is only the beginning, and not the ultimate goal. Nashorn has served as the proving ground for new approaches for implementing a dynamic language on top of the JVM, and we're eager to – once solidified – crystallize these into a reusable dynamic language implementer's toolkit. We have faced challenges of optimally mapping JavaScript local variables to JVM types (or: "hey, there's a static type inference algorithm in your dynamic language compiler"), doing liveness analysis, cutting up methods too large to fit into a single JVM method, efficiently representing large array and object literals in compiled code, creating a system for on-demand compilation of several type-specialized variants of the same function, and more. Along the way, we have reached the limits of our initial internal representation (fun fact: you can't do liveness analysis on an AST. We learned it the hard way.) and started sketching up an intermediate representation that would be easy to emit from a dynamic language compiler, and that could be taken over by a toolchain to perform the operations described above then on it and finally output standard Java bytecode for JIT to take over. Elevator pitch: like LLVM, but for dynamic languages on the JVM.
Efficient Memory and Thread Management in Highly Parallel Java Applicationspkoza
This presentation discusses strategies to estimate and control the memory use of multi-threaded java applications. It includes a quick overview of how the JVM uses memory, followed by techniques to estimate the memory usage of various types of objects during testing. This knowledge is then used as the basis for a runtime scheme to estimate and control the memory use of multiple threads. The final part of the presentation describes how to implement robust handling for unchecked exceptions, especially Out Of Memory (OOM) errors, and how to ensure threads stop properly when unexpected events occur.
Organizations continue to adopt Solr because of its ability to scale to meet even the most demanding workflows. Recently, LucidWorks has been leading the effort to identify, measure, and expand the limits of Solr. As part of this effort, we've learned a few things along the way that should prove useful for any organization wanting to scale Solr. Attendees will come away with a better understanding of how sharding and replication impact performance. Also, no benchmark is useful without being repeatable; Tim will also cover how to perform similar tests using the Solr-Scale-Toolkit in Amazon EC2.
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...jaxLondonConference
This presentation gives the busy Java/JVM developer an overview of how Garbage Collection in the JVM works and the common collectors that are used. We also cover how to read and interpret the scary log format and most importantly, offer strategies to deal with badly behaving memory (e.g. The dreaded OOME!).
Garbage collection v Javě, JVM generace a typy GC aneb způsob automatické správy paměti. Funguje tak, že speciální algoritmus (garbage collector) vyhledává a uvolňuje úseky paměti, které již program nebo proces nepoužívá. Šetří tak váš čas při vývoji.
It is easy to monitor the performance of JVM if one knows how GC and Threads work in JVM. This presentation throws light on Collector types, HotSpot Collection Algorithms, Thread Monitoring, Method Profiling and Heap Profiling
For More information, refer to Java EE 7 performance tuning and optimization book:
The book is published by Packt Publishing:
http://www.packtpub.com/java-ee-7-performance-tuning-and-optimization/book
This is a talk I did for JavaOne 2009. The focus of the talk was memory management and system monitoring with freely available tools that are in the jdk or open source.
The main body of work related to supporting dynamic languages on the JVM at Oracle today is done within the Nashorn project. While on the surface it looks like we're busy creating a JavaScript runtime, in reality JavaScript is only the beginning, and not the ultimate goal. Nashorn has served as the proving ground for new approaches for implementing a dynamic language on top of the JVM, and we're eager to – once solidified – crystallize these into a reusable dynamic language implementer's toolkit. We have faced challenges of optimally mapping JavaScript local variables to JVM types (or: "hey, there's a static type inference algorithm in your dynamic language compiler"), doing liveness analysis, cutting up methods too large to fit into a single JVM method, efficiently representing large array and object literals in compiled code, creating a system for on-demand compilation of several type-specialized variants of the same function, and more. Along the way, we have reached the limits of our initial internal representation (fun fact: you can't do liveness analysis on an AST. We learned it the hard way.) and started sketching up an intermediate representation that would be easy to emit from a dynamic language compiler, and that could be taken over by a toolchain to perform the operations described above then on it and finally output standard Java bytecode for JIT to take over. Elevator pitch: like LLVM, but for dynamic languages on the JVM.
Efficient Memory and Thread Management in Highly Parallel Java Applicationspkoza
This presentation discusses strategies to estimate and control the memory use of multi-threaded java applications. It includes a quick overview of how the JVM uses memory, followed by techniques to estimate the memory usage of various types of objects during testing. This knowledge is then used as the basis for a runtime scheme to estimate and control the memory use of multiple threads. The final part of the presentation describes how to implement robust handling for unchecked exceptions, especially Out Of Memory (OOM) errors, and how to ensure threads stop properly when unexpected events occur.
Organizations continue to adopt Solr because of its ability to scale to meet even the most demanding workflows. Recently, LucidWorks has been leading the effort to identify, measure, and expand the limits of Solr. As part of this effort, we've learned a few things along the way that should prove useful for any organization wanting to scale Solr. Attendees will come away with a better understanding of how sharding and replication impact performance. Also, no benchmark is useful without being repeatable; Tim will also cover how to perform similar tests using the Solr-Scale-Toolkit in Amazon EC2.
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...jaxLondonConference
This presentation gives the busy Java/JVM developer an overview of how Garbage Collection in the JVM works and the common collectors that are used. We also cover how to read and interpret the scary log format and most importantly, offer strategies to deal with badly behaving memory (e.g. The dreaded OOME!).
Garbage collection v Javě, JVM generace a typy GC aneb způsob automatické správy paměti. Funguje tak, že speciální algoritmus (garbage collector) vyhledává a uvolňuje úseky paměti, které již program nebo proces nepoužívá. Šetří tak váš čas při vývoji.
The Java memory model and the Garbage Collector can drive you into serious problems if you don't know how it runs, defrags, and remove objects - this presentation is not updated for Java 8.
Intro to GemStone/S
Mon, August 22, 3:30pm – 4:00pm
Youtube: https://youtu.be/NGMxjtOl8oA
Abstract: What is GemStone/S and how does it compare to other Smalltalks? This talk is intended to introduce you to a system that combines an ANSI-compliant Smalltalk application server with a full-featured multi-user database. In particular, because of the multi-user nature of the system, GemStone/S has implemented namespaces as well as class/object versioning. How this works presents interesting technical challenges.
Bio: As a junior-high student in 1971, James discovered the local university’s computer center and a life-long obsession with computers began. He was introduced to Smalltalk/V for the Mac in the mid-90s, and became a Smalltalk bigot. James is Director of Operations for GemTalk Systems and is a passionate advocate for GemStone and all things Smalltalk.
Mon, August 22, 2:00pm – 2:30pm
Youtube: https://youtu.be/OlJZMHLTfuc
Description
Abstract: Spur is the new memory manager for the Cog virtual machine used by Pharo, Newspeak and Squeak. It features a two generation scavenger garbage collector with an adaptative tenuring policy, lazy become, (transparent) segmented memory, a new 64bit-compatible object-format, ephemerons, pinned objects, a class table, among others. If you're high-level application developer, or a programming amateur, but not a VM expert, but you're interested in understanding these concepts and what is their impact on your day to day development this talk is for you.
Bio: Guille Polito is research engineer at CNRS, France. Pharoer since 2010, he participates actively in the Pharo open source community since several years. He currently works on the modularization of Pharo where he does software archeology, refactoring, library rewriting and participates in the Virtual Machine development.
This session is a look under the hood of the memory management done by the .net framework. It strives to explain the complexities that the garbage collector manages for us, and the means through which it does its magic.
Through hands-on examples, It shows places where we can help or hinder the performance of our application, if we understand the effects of the code we write on the underlying framework.
This indepth session talks about the basic concept of Memory Management and then Garbage Collector. It discusses in detail about .NET implementation of GC and best practice from personal experience
A presentation on how automatic memory management and adaptive compilation impact on latency of applications. Includes some ideas on how to minimise these affects.
Similar to Hotspot Garbage Collection - The Useful Parts (20)
The Diabolical Developer's Guide to Surviving Java 9jClarity
The Diabolical Developer presents a pragmatic guide on running and compiling your application on Java 9. There are a lot of new resrtictions due to the Java 9 modular runtime, so make sure you read through carefully before your migration!
The demands, techniques, paradigms and languages of modern software development have been changing at an ever increasing pace. This has left many software engineers bewildered, confused and feeling like they’re never going to be able to keep up, let alone be good enough! In the Java/JVM space there is a lot of tooling, libraries and APIs available to try and bridge the gaps of TDD, BDD, CI, Build, Static Code Analysis and so forth, but so many, many challenges still remain, like developing with RxJava e.g.
“Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element’s index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.”
WAT? Err get me out of here…..
The Diabolical Developer will take you through a journey of what problems are deemed to be ‘solved’, what problems are currently being worked on and the gaps that are likely to remain (which he fervently hopes you’re going to solve for him). He’ll share his dystopian view of the future where the modern challenges are tackled by sharp tools and clever thinking.
Most software development teams deliver applications over time, over budget and with a distinct lack of quality. However, some organisations and teams are orders of magnitude better, allowing their business to scale and be flexible in a rapidly changing world.
So how do you transform your organisation and teams from a cost center into part of your revenue generating business? How do you get your IT and software development teams to work at their creative best? How do you create those magic "x10" teams that the tech media keeps talking about?
Over the past 12 years Martijn Verburg (aka The Diabolical Developer) has specialised in transforming technical teams. From deep tech start-ups through to ponderous government departments, he'll cover the cultural and technical habits of the highly effective teams.
He's going to unveil the truth, and also tell you what not to do from bitter first, second and third hand experience.
Illuminate - Performance Analystics driven by Machine LearningjClarity
This is an introduction slide deck which gives you the motivation of why we built illuminate and why it is so very different to the traditional APMs out there!
Enterprise Java developers value reliability and stability, but what happens to your technology stack if you’re willing to take a risk? At jClarity we’re running production systems using HTML 5, AngularJS, Vert.x, Mongo, Groovy and deploying using Chef. Its been an interesting ride: some things worked really well and some things don’t.
Come along and find out what we’d recommend and what we’d avoid with hindsight. We’ll also talk about how we ended up with such a diverse stack and how to make technology choices in a fairer way. We’ve made the mistakes so you don’t have to!
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 3
Hotspot Garbage Collection - The Useful Parts
1. Hotspot Garbage Collection - The Useful Parts
Martijn Verburg (@karianna)
Dr John Oliver (@johno_oliver)
http://www.jclarity.com - @jclarity
1Thursday, 2 May 13
2. Who are we?
• Martijn Verburg (@karianna)
– CTO of jClarity
– aka "The Diabolical Developer"
– co-leader of the LJC
• Dr. John Oliver (@johno_oliver)
– Research Mentat at jClarity
• Strange title? Yes we're a start-up
– Can read raw GC log files
• "Empirical Science Wins"
2Thursday, 2 May 13
3. What I'm going to cover
• Part I - Diving into the Dark (~30 min)
– GC Theory
– Hotspot memory organisation and collectors
• Break! (2 min)
– Our brains hurt
• Part II - Shining a light into the Darkness (8 min)
– Reading GC Logs
– Tooling and Basic Data
• Part III - Real World Scenarios (8 min)
– Likely Memory Leaks
– Premature Promotion
– Healthy App
– High Pausing
3Thursday, 2 May 13
4. What I'm not covering
• G1 Collector
– It's supported in production now
– Not a lot of good independent empirical research on this
• JRockit, Azul Zing, IBM J9 etc
– Sorry, these warrant their own talks
– Go see Azul on level 3 though, what they do is... cool.
• PhD level technical explanations
– I want you to have a working understanding
• Reality: I'm not that smart
– Going for that PhD? See me after
4Thursday, 2 May 13
8. Part I - Diving into the Dark
• What is Garbage Collection (GC)?
• Hotspot Memory Organisation
• Collector Types
• Young Collectors
• Old Collectors
• Full GC
8Thursday, 2 May 13
9. What is Garbage Collection (GC)?
• The freeing of memory that is no longer "live"
– Otherwise known as "collecting dead objects"
• Which is a misnomer
• GC is typically executed by a managed runtime
• Javascript, Python, Ruby, .NET CLR all have GC
9Thursday, 2 May 13
10. And so does Java!
• One of the main 'selling' points in its early life
10Thursday, 2 May 13
11. Why should I care?
• Hotspot just sorts this out doesn't it?
• Just set -Xms and -Xmx to be == right?
– Stab myself in the eye with a fork
• A poorly tuned GC can lead to:
– High pause times / high % of time spent pausing
– OutOfMemoryError
• It's usually worth tuning the GC!
– "Cheap" performance gain
– Especially in the short to medium term
11Thursday, 2 May 13
12. Hotspot Java Virtual Machine
• Hotspot is a C/C++/Assembly app
– Native code for different platforms
– Roughly made up of Stack and Heap spaces
• The Java Heap
– A Contiguous block of memory
– Entire space is reserved
– Only some space is allocated
– Broken up into different memory pools
• Object Creation / Removal
– Objects are created by application (mutator) threads
– Objects are removed by Garbage Collection
12Thursday, 2 May 13
13. Memory Pools
• Young Generation Pools
– Eden
– Survivor 0
– Survivor 1
• Old Generation Pool (aka Tenured)
– Typically much larger than young gen pools combined
• PermGen Pool
– Held separately to the rest of the Heap
– Was intended to hold objects that last a JVM lifetime
• Reloading and recycling of classes occurs here.
– Going away in Java 8
13Thursday, 2 May 13
17. Copy
• aka "stop-and-copy"
– Some literature talks about "Cheney's algorithm"
• Used in many managed runtimes
– Including Hotspot
• GC thread(s) trace from root(s) to find live objects
• Typically involves copying live objects
– From one space to another space in memory
– The result typically looks like a move as opposed to a copy
17Thursday, 2 May 13
18. Mark and Sweep
• Used by many modern collectors
– Including Hotspot, usually for old generational collection
• Typically 2 mandatory and 1 optional step(s)
1.Find live objects (mark)
2.'Delete' dead objects (sweep)
3.Tidy up - optional (compact)
18Thursday, 2 May 13
19. Mark and Sweep collectors in Hotspot
• Several Hotspot collectors use Mark and Sweep
– Concurrent Mark and Sweep (CMS)
– Incremental Concurrent Mark and Sweep (iCMS)
– MarkSweepCompact (aka Serial)
– PS MarkSweep (aka ParallelOld)
• So it's worth learning the theory
19Thursday, 2 May 13
20. Java objects
• Java objects have Ordinary Object Pointers (OOPs)
– That point to an object...
– Which points to the header
• The header contains a mark bit for GC
– Plus other metadata (hashcodes, locking state etc)
• When you call a constructor
– Space for the object is allocated
20Thursday, 2 May 13
21. Step 1 - Clear the Mark
• The header contains the boolean mark field
– If true --> the object is live
• Step 1 - set all the mark fields to false
– We need to start afresh
21Thursday, 2 May 13
22. Step 2 - Mark live objects
• GC Roots
– A pointer to data in the heap that you need to keep
Copyright - Michael Triana
22Thursday, 2 May 13
23. Step 2 - Mark live objects
• GC Roots are made up of:
– Live threads
– Objects used for synchronisation
– JNI handles
– The system class loaders
– Possibly other things depending on your JVM
• Plus one more special case...
23Thursday, 2 May 13
24. Step 2 - Mark live objects
• Special case - Old Gen refs into Young Gen
– Treated as roots during a young collection
• Special card table to track these
– Each card references an area of 512 bytes in old gen
– If it references young gen it will have been marked as dirty
– Dirty areas are scanned as part of the young collection
• Conclusion - there's a lot to trace!
24Thursday, 2 May 13
25. Step 3 - Sweep
• Sweep
– Mark space that dead objects occupy as deleted
• Compact
– Not part of the normal operation of some collectors
– Always attempted before OOME's can be thrown
– 'Defrags' the remaining space
• Not quite a full defrag
• I'll cover some Java specific collectors shortly
25Thursday, 2 May 13
27. Young Generation Pools
• Eden
– Where new objects should get created
– Objects are added at the end of currently allocated block
– Uses Thread Local Allocation Buffers (TLABs)
• Points at end of allocated block of objects
• Survivor 0 and Survivor 1
– Known as Hemispheric GC
– Only one is active at a time
– The other one is empty, we call it the target space
27Thursday, 2 May 13
28. Young Generation Collectors
• When Eden gets "full"
– "Full" is technically passing a threshold
– A collector will run
• Live objects get copied to the target Survivor space
– From Eden and active Survivor space
• Some Live objects are promoted to Old Gen
– If they've survived > tenuringThreshold collections
– Or if they can't fit in the target space
• When the collector is finished
– A simple pointer swizzle activates the target Survivor space
– Dead objects effectively disappear (no longer referenced)
28Thursday, 2 May 13
30. Young Generation Collectors
• Most use parallel threads
– i.e. A multi-core machine can make your GC faster
• I'll cover the PS Scavenge and ParNew collectors
– They're almost identical
– PS Scavenge works with PS MarkSweep old gen
– ParNew works with ConcurrentMarkSweep (CMS) old gen
• Other young collectors:
– Copy (aka Serial)
– G1
30Thursday, 2 May 13
31. PS Scavenge / ParNew
• aka "Throughput collectors"
– Number of threads is set as a ratio to # of cores
• They're Stop-The-World (STW) collectors
– They're monolithic (as opposed to incremental)
• Each thread gets a set of GC roots
– They do work stealing
• It performs an copy (aka evacuate)
– Surviving objects move to the newly active survivor pool
31Thursday, 2 May 13
32. Age and Premature Promotion
• Objects have an age
• Every time they survive a collection..
– age++
• At age > tenuringThreshold
– Objects get moved (promoted) to old/tenured space
– Default tenuringThreshold is 4
• Premature Promotion occurs when
– High memory pressure (high life over death ratio)
• Eden is too small to deal with rate of new objects
– Objects are too big to fit in Eden
– Objects are too big to be promoted to Survivor spaces
32Thursday, 2 May 13
34. Old Generation Collectors
• Most are variations on Mark and Sweep
• Most use parallel threads
– e.g. A multi-core machine can make your GC faster
• I'll cover PS MarkSweep & CMS
– CMS is often paired with the ParNew young collector
• Other old collectors:
– MarkSweepCompact (aka Serial)
– Incremental CMS (iCMS)
– G1
34Thursday, 2 May 13
35. PS MarkSweep
• aka "ParallelOld"
– Often paired with PS Scavenge for young gen
• Parallel GC threads get sections to look after
– Usual Mark and Sweep occur
• Special Compact phase takes place
– low occupancy sections get merged
– e.g. A compact / defrag operation
35Thursday, 2 May 13
36. CMS Old Gen Collector
• Only runs when Tenured is about to get full
– Tunable as to what 'about to get full' means
• Attempts to share CPU with application
– About a 50/50 ratio as a default
– Application can keep working whilst GC is taking place
• It's a partial Stop-The-World (STW) collector
– It has 6 phases
• 2 STW
• 4 Concurrent
• It does not compact unless it fails..
36Thursday, 2 May 13
37. CMS Phases
• Phase 1 - Initial Mark (STW)
– Marks objects adjacent to GC roots
• Phase 2 - Mark (Concurrent)
– Completes depth first marking
• Phase 3 - Pre Clean (Concurrent)
– Retraces the updated objects, finds dirty cards
• Phase 4 - Re Mark / Re Scan (STW)
– Hopefully a smaller graph traversal over dirty paths
• Phase 5/6 - Concurrent Sweep and Reset
– Sweep out dead objects and reset any data structures
37Thursday, 2 May 13
38. Concurrent Mode Failure (CMF)
• Occurs when CMS can't complete 'in time'
– 'In time' meaning that tenured has filled up
• GC subsystem reverts to a Full GC at this point
– Basically ouch
38Thursday, 2 May 13
39. Promotion Failure
• Occurs when objects can't be promoted into Tenured
– Often due to the Swiss Cheese nature of Old Gen
• Because CMS does not compact
• This will almost always happen.... eventually
• Triggers a Full GC
– Which compacts old space
– No more Swiss Cheese! For a short while...
39Thursday, 2 May 13
40. Full GC
• Can be triggered by a number of causes
– A CMF from the CMS Collector
– Promotion Failure
– When tenured gets above a threshold
– System.gc()
– Remote System.gc() via RMI
• Runs a full STW collection
– Over Young and Old generational spaces
– Compacts as well
40Thursday, 2 May 13
42. Special Case: OOME
• 98%+ time is spent in GC
• < 2% of Heap is freed in a collection
• Allocating an object larger than heap
• Sometimes when the JVM can't spawn a new Thread
42Thursday, 2 May 13
43. Part II - Shining a light into the dark
• Collector Flags ahoy
• Reading CMS Log records
• Tooling and basic data
43Thursday, 2 May 13
44. 'Mandatory' Flags
• -verbose:gc
– Get me some GC output
• -Xloggc:<pathtofile>
– Path to the log output, make sure you've got disk space
• -XX:+PrintGCDetails
– Minimum information for tools to help
– Replace -verbose:gc with this
• -XX:+PrintTenuringDistribution
– Premature promotion information
• -XX:+PrintGCApplicationStoppedTime
44Thursday, 2 May 13
45. Basic Heap Sizing Flags
• -Xms<size>
– Set the minimum size reserved for the heap
• -Xmx<size>
– Set the maximum size reserved for the heap
• -XX:MaxPermSize=<size>
– Set the maximum size of your perm gen
– Good for Spring apps and App servers
45Thursday, 2 May 13
47. More Flags than your Deity
Copyright Frank Pavageau
47Thursday, 2 May 13
48. Why Log Files?
• Log file can be post processed
• Log files contain more information
– Than runtime MXBeans
• Runtime MXBeans impact the running application
– Causing it's own GC problems!
48Thursday, 2 May 13
56. Tooling
• HPJMeter (Google it)
– Solid, but no longer supported / enhanced
• GCViewer (http://www.tagtraum.com/gcviewer.html)
– Has rudimentary G1 support
• GarbageCat (http://code.google.com/a/eclipselabs.org/p/garbagecat/)
– Best name
• IBM GCMV (http://www.ibm.com/developerworks/java/jdk/tools/gcmv/)
– J9 support
• jClarity Censum (http://www.jclarity.com/products/censum)
– The prettiest and most useful, but we're biased!
56Thursday, 2 May 13
59. Part III - Scenarios
• Possible Memory Leak(s)
• Premature Promotion
• Healthy Application
• High percentage of time spent pausing
59Thursday, 2 May 13
66. Summary
• You need to understand some basic GC theory
• You want most objects to die young, in young gen
• Turn on GC logging!
– Reading raw log files is hard
– Use tooling!
• Use tools to help you tweak
– "Empirical Science Wins!"
66Thursday, 2 May 13
67. Join our performance community
http://www.jclarity.com
Martijn Verburg (@karianna)
Dr John Oliver (@johno_oliver)
67Thursday, 2 May 13