English version of the presentation we gave at Devoxx FR 2012.
In depth analysis on how java Garbage collector works and how to minimise pause in your application.
In this session we’ll leave the need for performance a foregone conclusion and take a whirlwind tour through the complexity of modern Internet architectures. The complexities lead to evil optimization problems and significant challenges troubleshooting production issues to a speedy and successful end.
Starting with the simple facts that you can’t fix what you can’t see and you can’t improve what you can’t measure, we’ll discuss what needs monitoring and why. We’ll talk about unlikely allies in the fight for time and budget to instrument systems, applications and processes for observability.
You’ll leave the session with a better understanding of what it looks like to troubleshoot the storm of a malfunctioning large architecture and some tools and techniques you can use to not be swallowed by the Kraken.
In this session we’ll leave the need for performance a foregone conclusion and take a whirlwind tour through the complexity of modern Internet architectures. The complexities lead to evil optimization problems and significant challenges troubleshooting production issues to a speedy and successful end.
Starting with the simple facts that you can’t fix what you can’t see and you can’t improve what you can’t measure, we’ll discuss what needs monitoring and why. We’ll talk about unlikely allies in the fight for time and budget to instrument systems, applications and processes for observability.
You’ll leave the session with a better understanding of what it looks like to troubleshoot the storm of a malfunctioning large architecture and some tools and techniques you can use to not be swallowed by the Kraken.
The Java Memory Model describes how threads in the Java programming language interact through memory. Together with the description of single-threaded execution of code, the memory model provides the semantics of the Java programming language.
It is crucial for a programmer to know how, according to Java Language Specification, write correctly synchronized, race free programs.
Java Memory Consistency Model - concepts and contextTomek Borek
Java Memory Consistency Model is a difficult topic.
It's useful in making sure that multi-threaded programs on multi-threaded cores will interact with each other (and through memory) in a consistent manner.
It's specification is damn hard (even according to folks with lots of concurrent experience, like Doug Lea) to read, understand and routinely follow without error.
This presentation talks about some fallacies surrounding memory model, explains it, offers definitions and reasons for it's existence. It ain't deep, it's more entry level stuff.
This slide will explain about building blocks of JVM optimization for you java based application.
It explains basics of heap concepts and different type of java garbage collectors.
This presentation is primarily based on Oracle's "Java SE 6 HotSpot™ Virtual Machine Garbage Collection Tuning" document.
This introduces how Java manages memory using generations, available garbage collectors and how to tune them to achieve desired performance.
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
Nowadays people usually talk more about big data, internet of things, and other buzzwords on various conferences. However, sometimes developers tend to not pay enough attention to the core things such as garbage collection. After having a short discussion with many somewhat experienced Java developers I came to a conclusion that most of them do not know how many garbage collectors there are in the latest JVM, and under what circumstances each of them should be enabled. This presentation is aimed to improve or refresh people’s knowledge on this core topic, and share a real use case when it helped us to resolve production issue.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
Inside the Atlassian OnDemand Private CloudAtlassian
In order to launch Atlassian OnDemand, we needed to rethink the way we did infrastructure. Join Atlassian SaaS Platform Architect, George Barnett as he discusses how we delivered a scalable platform that runs tens of thousands of JVMs, all while reducing the cost by ten-fold. This talk will cover design decisions, technology choices and the lessons learned during the build out.
The Java Memory Model describes how threads in the Java programming language interact through memory. Together with the description of single-threaded execution of code, the memory model provides the semantics of the Java programming language.
It is crucial for a programmer to know how, according to Java Language Specification, write correctly synchronized, race free programs.
Java Memory Consistency Model - concepts and contextTomek Borek
Java Memory Consistency Model is a difficult topic.
It's useful in making sure that multi-threaded programs on multi-threaded cores will interact with each other (and through memory) in a consistent manner.
It's specification is damn hard (even according to folks with lots of concurrent experience, like Doug Lea) to read, understand and routinely follow without error.
This presentation talks about some fallacies surrounding memory model, explains it, offers definitions and reasons for it's existence. It ain't deep, it's more entry level stuff.
This slide will explain about building blocks of JVM optimization for you java based application.
It explains basics of heap concepts and different type of java garbage collectors.
This presentation is primarily based on Oracle's "Java SE 6 HotSpot™ Virtual Machine Garbage Collection Tuning" document.
This introduces how Java manages memory using generations, available garbage collectors and how to tune them to achieve desired performance.
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
Nowadays people usually talk more about big data, internet of things, and other buzzwords on various conferences. However, sometimes developers tend to not pay enough attention to the core things such as garbage collection. After having a short discussion with many somewhat experienced Java developers I came to a conclusion that most of them do not know how many garbage collectors there are in the latest JVM, and under what circumstances each of them should be enabled. This presentation is aimed to improve or refresh people’s knowledge on this core topic, and share a real use case when it helped us to resolve production issue.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
Inside the Atlassian OnDemand Private CloudAtlassian
In order to launch Atlassian OnDemand, we needed to rethink the way we did infrastructure. Join Atlassian SaaS Platform Architect, George Barnett as he discusses how we delivered a scalable platform that runs tens of thousands of JVMs, all while reducing the cost by ten-fold. This talk will cover design decisions, technology choices and the lessons learned during the build out.
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.comIlya Grigorik
A high-performance proxy server is less than a hundred lines of Ruby code and it is an indispensable tool for anyone who knows how to use it. In this session we will first walk through the basics of event-driven architectures and high-performance network programming in Ruby using the EventMachine framework.
Big Data & Cloud | Cloud Storage Simplified | Adrian ColeJAX London
2011-11-01 | 04:20 PM - 05:10 PM
Key/value stores are the most common storage offerings in the cloud today. We'll introduce storage concepts and differences between cloud storage providers including Amazon S3, Rackspace Cloud Files & Microsoft Azure Blob Service. We'll demonstrate how jclouds BlobStore helps Java and Clojure developers avoid lock-in and increase testability without restricting access to provider-specific features
Microbox : Ma toolbox microservices - Julien Royekino
Malgré les bénéfices indéniables des architectures microservices, elles apportent une complexité non négligeable. Durant cette session, je vous présenterai la collection d’outils open source ou développé en interne que nous utilisons sur nos différents projets microservices pour limiter les délais de mise en oeuvre de ce type d’architecture. Depuis la gestion des sources jusqu’au monitoring en passant par la génération de projets et l’usine de build nous parcourrons en live l’utilisation de ces différents outils.
Spring data : Une api, quinze possibilités - Julien Royekino
Vous avez besoin d’intégrer une nouveau type de stockage ( Elasticsearch, Cassandra, Redis, Neo4j ) dans votre application mais l’apprentissage d’une nouvelle API vous fait hésiter ? Spring Data est fait pour vous ! Grâce à Spring Data, vous avez à disposition une interface unique pour communiquer avec tous vos backends. Venez découvrir comment faire un stream de données depuis Postgresql, faire des agrégations avec Elasticsearch, enregistrer des documents dans MongoDB, le tout en quelques lignes de code et sans efforts. Nous finirons cette session en détaillant les nouveautés apportées par la version 2.0 autour de la programmation réactive.
Se lancer dans l'aventure microservices avec Spring Cloud - Julien Royekino
Vous êtes convaincus par l’architecture micro-services et vous souhaitez vous lancer dans l'aventure. Durant cette session, nous expliquons comment démarrer concrètement ; quelles sont les nouvelles problématiques que soulève cette architecture et comment les résoudre. Nous détaillons – à travers une application de démonstration qui implémente les concepts de Service Discovery, Circuit Breaker, Routing et Client Side Load Balancing – l'utilisation de la libraire Spring Cloud Netflix (Eureka, Hystrix, Ribbon , ...). Nous survolerons ensuite les différentes alternatives développées par les autres géants du Web tels que Twitter, Airbnb, ...
Les statistiques d’utilisation des téléphones mobiles sont en constante progression et trois choix se dessinent actuellement pour délivrer du contenu sur le Web. Un site responsive, un site dédié mobile ou une application disponible sur un store. Et dans ce dernier cas, vous serez très vite confronté aux contraintes des différents systèmes d’exploitation : Android, iOS et Windows Phone – pour les majoritaires. Dans ce contexte, beaucoup d’outils de développement émergent avec un seul objectif : réutiliser les compétences des développeurs Web et mutualiser le code entre les différentes plate-formes. Cette présentation se base sur le retour d’expérience réussie autour de la mise en place de prototypes et de projets client chez Ekino. Je vais vous exposer les solutions que nous n’avons pas retenues en expliquant nos choix. Puis je vais parcourir plus en détail les solutions que nous avons testées : Apache Cordova, Ionic, SuperSonic, ReactNative, etc. Nous verrons que l’expression “Write once, run everywhere” n’est pas toujours vrai. Le but est qu’à la sortie de cette conférence, je vous aie aidé à faire vos choix techniques, en fonction de vos projets et de vos compétences !
Le « RUN » (ou la Tierce Maintenance Applicative)ekino
Après avoir mis en ligne un nouveau site web, on entre dans une phase dite de « RUN » ou plus précisément en Tierce Maintenance Applicative (TMA). Il s’agit d’assurer une maintenance corrective, mais pas seulement… Il faut prendre en compte la maintenance préventive, la maintenance adaptative, le support fonctionnel, l’exploitation, etc.
Or il y a souvent des confusions entre toutes ces notions. Je propose de partager leur définition et quelques bonnes pratiques de mise en œuvre, tout en illustrant la spécificité de chacune de ces maintenances à partir de situations empruntées aux classiques du cinéma.
La technologie Kinect n’est pas nouvelle, elle avait beaucoup fait parler d’elle en 2010/2011. Microsoft ayant sorti sa nouvelle version dédiée à Windows en juillet 2014, où en sommes-nous aujourd’hui avec cette technologie ? Que peut-on faire et ne pas faire, notamment en choisissant la technologie HTML5 ? Fort d'une expérience réussie et après avoir développé une application disponible lors du salon de la lingerie via la Kinect, mais aussi sur le Web via la souris nous verrons lors de cette présentation tout les tenant et aboutissant pour réussir un projet Kinect HTML5.
L’usage de Symfony2, l’organisation du code et l’usage du projet Sonata chez Canal+ pour répondre aux enjeux de la refonte d’une partie de la plateforme web. La plateforme présente de nombreux challenges techniques : SDK, API privée, API publique restful+hal, création de contenus riches, huit applications différentes avec une base de code commune, etc. Comment il a été possible d’améliorer certaines parties de Sonata ainsi que l’approche choisie pour la création de certains composants transverses.
À partir de la conférence de Raphaël Yharrassarry sur "Science-Fiction et Interaction" (http://www.paris-web.fr/2014/conferences/science-fiction-interaction.php), nous interrogeons l'expérience qu'offrent les objets connectés et nous étudions ce qu'est une expérience complète dans un tel contexte. Enfin, nous en dégageons les critères fondamentaux qui définissent une expérience réussie.
Drupagora 2013 : Drupal8 et Symfony2, quel impact ?ekino
Nombreuses sont les directions digitales ayant aussi bien des besoins éditoriaux que métiers. D'un point de vue business, il n'est pas possible de séparer les deux.
Basiquement, quels choix avons-nous ?
- partir sur un CMS et coder en "CMS"...
- partir sur un framework et réinventer le CMS...
Aujourd'hui, une des solutions est d'alier le meilleur des 2 mondes, mais a aussi ses problématiques :
- comment faire communiquer les 2 solutions ?
- où trouver les bons profils compte tenu de expertise différentes ?
- comment ne pas complexifier la maintenance et l'exploitation ?
Bref, pour ce qui est d'aujourd'hui, c'est possible, mais difficile... Mais demain ?
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
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.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
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.
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.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Knowledge engineering: from people to machines and back
Java GC - Pause tuning
1. Death by pauses Everything you ever wanted to know about GC pauses*
*but were afraid to ask
1
Tuesday, July 10, 12
2. Agenda
1. Introduction
2. Crime Scene Investigation
3. JVM Memory management systems and tools
4. Putting it together
2
Tuesday, July 10, 12
3. The Crime Scene
PG 13*
* Parents strongly cautioned: typed language, dead objects and verbose logs may not be suitable to scripting language fans
3
Tuesday, July 10, 12
6. B2C
e-commerce platform
Apache
•12+ Servers
Tomcat
•10 different Webapps
•50+ JVMs (Oracle JDK6)
•> 30000 sessions
•250-400 Req/s
Oracle
•Variance is high
4
Tuesday, July 10, 12
7. ... an unusual victim...
Product catalog modeled as a Graph
100% custom implementation
100% on-heap (no SQL except for initial load)
in-place update by AtomicReference.set()
5
Tuesday, July 10, 12
8. ... an unusual victim...
Product catalog modeled as a Graph
100% custom implementation
100% on-heap (no SQL except for initial load)
in-place update by AtomicReference.set()
Caching aggressively is not possible
Large number of request-scoped objects
Many WS into backoffice systems = latency
5
Tuesday, July 10, 12
24. The usual suspects...
• OutOfMemory Heap
• OutOfMemory PermGen
12
Tuesday, July 10, 12
25. The usual suspects...
• OutOfMemory Heap
• OutOfMemory PermGen
• Long GC pauses
12
Tuesday, July 10, 12
26. The usual suspects...
• OutOfMemory Heap
• OutOfMemory PermGen
• Long GC pauses
➡ under high load = immediate death
12
Tuesday, July 10, 12
27. The usual suspects...
• OutOfMemory Heap
• OutOfMemory PermGen
• Long GC pauses
➡ under high load = immediate death
12
Tuesday, July 10, 12
28. The usual suspects...
• OutOfMemory Heap
• OutOfMemory PermGen
• Long GC pauses
➡ under high load = immediate death
12
Tuesday, July 10, 12
29. a
e st h b yThe usual suspects...
•
• D e
OutOfMemory Heap
s
OutOfMemory PermGen
•
p au
Long GC pauses
➡ under high load = immediate death
12
Tuesday, July 10, 12
30. Why do we need this GC thing again ?
“Many concurrent algorithms are very easy to
write with a GC and totally hard (to down right
impossible) using explicit free.”
Cliff Click
13
Tuesday, July 10, 12
31. Fine, we just need to tune the JVM, right?...
14
Tuesday, July 10, 12
32. Fine, we just need to tune the JVM, right?...
14
Tuesday, July 10, 12
33. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
34. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
35. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
100 <= X< 200
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
36. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
100 <= X< 200
200 <= X< 300
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
37. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
100 <= X< 200
200 <= X< 300
300 <= X< 400
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
38. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
100 <= X< 200
200 <= X< 300
300 <= X< 400
400 <= X< 500
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
39. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
100 <= X< 200
200 <= X< 300
300 <= X< 400
400 <= X< 500
500 <= X< 600
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
40. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
100 <= X< 200
200 <= X< 300
300 <= X< 400
400 <= X< 500
500 <= X< 600
600 <= X< 700
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
41. Fine, we just need to tune the JVM, right?...
POP QUIZZ!
Number of command-line flags*?
less than 100 flags
100 <= X< 200
200 <= X< 300
300 <= X< 400
400 <= X< 500
500 <= X< 600
600 <= X< 700 664 Flags!
* Oracle JVM 1.6.0_31 x86_64 server
14
Tuesday, July 10, 12
72. Garbage Collectors
• Générational
• Stop the world!
• Throughput or Concurrent
44
Tuesday, July 10, 12
73. GC characteristics
Young
Serial Parallel
Serial
Old Parallel
Concurrent
45
Tuesday, July 10, 12
74. GC characteristics
Young
Serial Parallel
Serial Default
Old Parallel N/A
Concurrent
46
Tuesday, July 10, 12
75. GC characteristics
Young
Serial Parallel
Serial
Old Parallel
Concurrent
47
Tuesday, July 10, 12
76. GC characteristics
Young
Serial Parallel
Serial Serial
Old Parallel
Concurrent
47
Tuesday, July 10, 12
77. GC characteristics
Young
Serial Parallel
Serial Serial Parallel
Old Parallel
Concurrent
47
Tuesday, July 10, 12
78. GC characteristics
Young
Serial Parallel
Serial Serial Parallel
Old Parallel ParallelOld
Concurrent
47
Tuesday, July 10, 12
79. GC characteristics
Young
Serial Parallel
Serial Serial Parallel
Old Parallel ParallelOld
Concurrent CMS
47
Tuesday, July 10, 12
80. GC characteristics
Young
Serial Parallel
Serial Serial Parallel
Old Parallel ParallelOld
Concurrent CMS Serial CMS
47
Tuesday, July 10, 12
81. GC characteristics
Young
Serial Parallel
Serial Serial Parallel
Old Parallel ParallelOld
Concurrent CMS Serial CMS
Parallel implementation actually differ for each variant
48
Tuesday, July 10, 12
84. CMS is the right choice
Serial 917
Parallel 852
ParallelOld 846
CMS 871
CMS Serial 937
0 250 500 750 1000
Average test duration (s)
50
Tuesday, July 10, 12
85. Tools: CLI
jps, jhat, jmap, jstack, jstat
$ jstat -gcutil PID
S0 S1 E O P YGC YGCT FGC FGCT GCT
0.00 40.88 58.41 18.34 66.65 2729 316.538 46 6.820 323.358
51
Tuesday, July 10, 12
99. OK, so we can measure... temperature!!
56
Tuesday, July 10, 12
100. OK, so we can measure... temperature !
=
57
Tuesday, July 10, 12
101. But...a single temperature measure is not enough to diagnose anything!
We must archive all measurements
to know the baseline!
Credit: http://www.lhup.edu/mkhalequ/fieldtrip/geos253.htm
58
Tuesday, July 10, 12
102. Therefore we must persist all measurements!
• JMX + jmxtrans
• RRD
• Graphite
• etc.
59
Tuesday, July 10, 12
103. Operating the (many) switches only makes sense...
Credit: http://www.our-energy.com
60
Tuesday, July 10, 12
104. ...if we can measure/compare the effects!
Before
cputime
After
61
Tuesday, July 10, 12
108. JVM
Tomcat
vs.
Application
(code)
64
Tuesday, July 10, 12
109. 1. Code
• Tuning the JVM cannot compensate for bad code
• Rules of thumb
• Immutability = object reuse = less allocations *
• Move code invariants out of tight loops
• Know the characteristics of your data structures & frameworks (java.util,
Guava, Hibernate, etc.)
• Mind the gap: data structure overhead can kill you!
* But...pooling can be counter-productive!
65
Tuesday, July 10, 12
110. Example : HashMap
HashMap 48
Entry[16] 80 key
Entry 32
value
66
Tuesday, July 10, 12
111. Example : HashMap
HashMap 48
Entry[16] 80 key
Overhead = 160 Bytes! Entry 32
value
66
Tuesday, July 10, 12
112. Example : HashMap
HashMap 48
Entry[16] 80 key
Overhead = 160 Bytes! Entry 32
value
•SingletonMap (40 Bytes)
•initialCapacity + loadFactor
66
Tuesday, July 10, 12
113. GC Young / s Less allocations...
67
Tuesday, July 10, 12
114. Charge CPU ... saves CPU
68
Tuesday, July 10, 12
115. 2. Tomcat
• Pooling
• JSP tags: enablePooling in web/webdefault.xml
• -Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false
• Careful with buffers and their reuse
• -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
• JSP usage is a factor in PermGen requirements
• Test & Measure, always!
69
Tuesday, July 10, 12
116. 2. Tomcat
• Pooling
Pooling may lead
• JSP tags: enablePooling in web/webdefault.xml
!
to Old
fragmentation!
• -Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false
• Careful with buffers and their reuse
• -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
• JSP usage is a factor in PermGen requirements
• Test & Measure, always!
69
Tuesday, July 10, 12
117. 3. Heap Size The JVM
Time
Heap Size
Time
70
Tuesday, July 10, 12
118. 3. The JVM
pause > 1s !
Heap Size
Time
Heap Size
Time
70
Tuesday, July 10, 12
119. 3. The JVM
pause > 1s !
Heap Size
Time
Heap Size
Frequent GC
Time
70
Tuesday, July 10, 12
126. First mistake: setting the Young too small
Old
Young fills up quickly = many GC Young
Objects promoted to Tenured too fast =
Young many GC Old
73
Tuesday, July 10, 12
136. Old generation : ideal vs. real
Rate increases
79
Tuesday, July 10, 12
137. Things to watch for
• Traffic/Load variance
• Traffic increases => Memory pressure increase
• CMS requires some headroom to operate properly
• Several phases are concurrent, i.e. at the same time as new objects are
allocated
80
Tuesday, July 10, 12
138. Things to watch for
• Traffic/Load variance
• Traffic increases => Memory pressure increase
• CMS requires some headroom to operate properly
• Several phases are concurrent, i.e. at the same time as new objects are
allocated
(concurrent mode failure): 2165740K->1284261K(2228224K), 8.9411250 secs
80
Tuesday, July 10, 12
139. Giving CMS some room to operate
Old
Young
81
Tuesday, July 10, 12
140. Giving CMS some room to operate
CMSInitiatingOccupancyFraction = 92%
This is the default....
Old
Young
81
Tuesday, July 10, 12
141. Giving CMS some room to operate
We really need 75-80%
UseCMSInitiatingOccupancyOnly to force
the JVM to only consider this criteria
Old
Young
81
Tuesday, July 10, 12
153. What’s next?
• Survivors tuning (S0 & S1)
• Size, ratio vs. Eden, max generation
• G1
• Principles and operations are radically different!
• Other JVMs : JRockit, Azul, IBM
• Check tuning validity after every code change!
• Measure, measure, measure!
89
Tuesday, July 10, 12