Guest lecture at University of Colombo School of Computing on 30th May 2018
Covers following topics:
Software Profiling
Measuring Performance
Java Garbage Collection
Sampling vs Instrumentation
Java Profilers. Java Flight Recorder
Java Just-in-Time (JIT) compilation
Flame Graphs
Linux Profiling
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...Spark Summit
What if you could get the simplicity, convenience, interoperability, and storage niceties of an old-fashioned CSV with the speed of a NoSQL database and the storage requirements of a gzipped file? Enter Parquet.
At The Weather Company, Parquet files are a quietly awesome and deeply integral part of our Spark-driven analytics workflow. Using Spark + Parquet, we’ve built a blazing fast, storage-efficient, query-efficient data lake and a suite of tools to accompany it.
We will give a technical overview of how Parquet works and how recent improvements from Tungsten enable SparkSQL to take advantage of this design to provide fast queries by overcoming two major bottlenecks of distributed analytics: communication costs (IO bound) and data decoding (CPU bound).
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaSridhar Kumar N
https://www.youtube.com/playlist?list=PLAiEy9H6ItrKC5PbH7KiELiSEIKv3tuov
-What is Prometheus?
-Difference Between Nagios vs Prometheus
-Architecture
-Alertmanager
-Time series DB
-PromQL (Prometheus Query Language)
-Live Demo
-Grafana
"It can always get worse!" – Lessons Learned in over 20 years working with Or...Markus Michalewicz
First presented during the DOAG 2022 Conference and Exhibition, this presentation discusses and reviews the most significant lessons learned in over 20 years of working with Oracle Maximum Availability Architecture. It explains why documentation is good, but automated checks are better, and why standardization can help increase the availability of nearly all systems, including database systems.
The Top 5 Reasons to Deploy Your Applications on Oracle RACMarkus Michalewicz
A presentation for developers, DBAs, and managers. This presentation was first presented in course of the AIOUG Maximum Availability Architecture (MAA)-focus month August 2021. The first reason might surprise you!
Oracle Open World (OOW) 2014 presentation on Oracle Cache Fusion; how it works and how to use it in an optimized fashion to scale an Oracle RAC system.
Make Your Application “Oracle RAC Ready” & Test For ItMarkus Michalewicz
This presentation talks about the secrets behind Oracle RAC’s horizontal scaling algorithm, Cache Fusion, and how you can ensure that your application is “Oracle RAC ready.”. It discusses do's and don'ts and how to test your application for "Oracle RAC readiness". This version was first presented in Sangam19.
Software Profiling: Understanding Java Performance and how to profile in JavaIsuru Perera
Guest lecture at University of Colombo School of Computing on 27th May 2017
Covers following topics:
Software Profiling
Measuring Performance
Java Garbage Collection
Sampling vs Instrumentation
Java Profilers. Java Flight Recorder
Java Just-in-Time (JIT) compilation
Flame Graphs
Linux Profiling
Java Performance and Using Java Flight RecorderIsuru Perera
Slides used for an internal training. Explains why throughput and latency are important when measuring performance. How Java Flight Recording can be used to analyze performance issues.
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...Spark Summit
What if you could get the simplicity, convenience, interoperability, and storage niceties of an old-fashioned CSV with the speed of a NoSQL database and the storage requirements of a gzipped file? Enter Parquet.
At The Weather Company, Parquet files are a quietly awesome and deeply integral part of our Spark-driven analytics workflow. Using Spark + Parquet, we’ve built a blazing fast, storage-efficient, query-efficient data lake and a suite of tools to accompany it.
We will give a technical overview of how Parquet works and how recent improvements from Tungsten enable SparkSQL to take advantage of this design to provide fast queries by overcoming two major bottlenecks of distributed analytics: communication costs (IO bound) and data decoding (CPU bound).
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaSridhar Kumar N
https://www.youtube.com/playlist?list=PLAiEy9H6ItrKC5PbH7KiELiSEIKv3tuov
-What is Prometheus?
-Difference Between Nagios vs Prometheus
-Architecture
-Alertmanager
-Time series DB
-PromQL (Prometheus Query Language)
-Live Demo
-Grafana
"It can always get worse!" – Lessons Learned in over 20 years working with Or...Markus Michalewicz
First presented during the DOAG 2022 Conference and Exhibition, this presentation discusses and reviews the most significant lessons learned in over 20 years of working with Oracle Maximum Availability Architecture. It explains why documentation is good, but automated checks are better, and why standardization can help increase the availability of nearly all systems, including database systems.
The Top 5 Reasons to Deploy Your Applications on Oracle RACMarkus Michalewicz
A presentation for developers, DBAs, and managers. This presentation was first presented in course of the AIOUG Maximum Availability Architecture (MAA)-focus month August 2021. The first reason might surprise you!
Oracle Open World (OOW) 2014 presentation on Oracle Cache Fusion; how it works and how to use it in an optimized fashion to scale an Oracle RAC system.
Make Your Application “Oracle RAC Ready” & Test For ItMarkus Michalewicz
This presentation talks about the secrets behind Oracle RAC’s horizontal scaling algorithm, Cache Fusion, and how you can ensure that your application is “Oracle RAC ready.”. It discusses do's and don'ts and how to test your application for "Oracle RAC readiness". This version was first presented in Sangam19.
Software Profiling: Understanding Java Performance and how to profile in JavaIsuru Perera
Guest lecture at University of Colombo School of Computing on 27th May 2017
Covers following topics:
Software Profiling
Measuring Performance
Java Garbage Collection
Sampling vs Instrumentation
Java Profilers. Java Flight Recorder
Java Just-in-Time (JIT) compilation
Flame Graphs
Linux Profiling
Java Performance and Using Java Flight RecorderIsuru Perera
Slides used for an internal training. Explains why throughput and latency are important when measuring performance. How Java Flight Recording can be used to analyze performance issues.
Java is one of the most popular languages and it's very important to understand the performance of Java servers. Modern JVMs compile the Java code in runtime using Just-In-Time (JIT) compiler and such JIT compiled code runs very close to optimized native code in terms of speed.
When understanding performance, it's important to know how Java works and we can also measure the performance using key metrics like Throughput and Latency. After measuring the performance, we can use profilers to understand the application behavior and find performance bottlenecks.
In this session, we will look at how Java manages the memory and how it optimizes the Java code using JIT compilation. We will also look at how we can use the Java Flight Recorder (JFR) to profile the JVM and find performance bottlenecks.
Finally, we can look at how "Flame Graphs" can be used to identify the most frequent code-paths quickly and accurately.
Java is finally elastic! OpenJDK improvements and new features in Garbage Collection technology resulted in enhancing Java vertical scaling and resource consumption. Now JVM can promptly return unused memory and, as result it can go up and down automatically. In this presentation, we cover the main achievements in vertical scaling direction, as well as share peculiarities and tuning details of different GCs. Find out how to make your Java environments more elastic to follow the load and lower down the total cost of ownership at a large scale.
This presentation was given to the system adminstration team to give them an idea of how GC works and what to look for when there is abottleneck and troubles.
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...Jelastic Multi-Cloud PaaS
Being configured smartly, Java can be scalable and cost-effective for all ranges of projects — from cloud-native startups to legacy enterprise applications. During this session, we will share our experiences in tuning RAM usage in a Java process to make it more elastic and gain the benefits of faster scaling and lower total cost of ownership (TCO). With microservices, cloud hosting, and vertical scaling in mind, we'll compare the top Java garbage collectors to see how efficiently they handle memory resources. The provided results of testing G1, Parallel, ConcMarkSweep, Serial, Shenandoah, ZGC and OpenJ9 garbage collectors while scaling Java EE applications vertically will help you to make the right choice for own projects.
More details about Garbage Collector types https://jelastic.com/blog/garbage-collection/
Free registration at Jelastic https://jelastic.com/
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageJelastic Multi-Cloud PaaS
With microservices, cloud hosting, and vertical scaling in mind, we'll compare the top Java garbage collectors to see how efficiently they handle memory resources. Being configured smartly, Java can be cost-effective for all ranges of projects — from cloud-native startups to legacy enterprise applications. And the selected garbage collection algorithm is one of the main foundational bricks here, as its settings can influence the whole project. In this presentation, we share our experiences in tuning RAM usage in a Java process to make it more elastic and gain the benefits of faster scaling and lower total cost of ownership (TCO). The provided results of testing G1, Parallel, ConcMarkSweep, Serial, Shenandoah, ZGC, C4 and OpenJ9 garabage collectors while scaling Java applications vertically will help you to make the right choice for own projects.
What to do in case in which an application does not provide the desired performance? If you have ever had problems with optimizing the performance of Java applications, surely you had to invest a solid amount of time to find out the real cause for the problems, which included the involvement of administrators and developers. Is there a way to shorten the time required to find a solution, what free tools are available for this purpose and to check that you have finally solved the problem? In this presentation, we will try to provide answers to these questions with concrete real life examples.
So you've been deploying Java in the cloud and are wondering how to handle the new world of containers, microservices, and memory constraints. Cold starts got you down? Come to this session to learn about how the OpenJ9 and the JVM in general can help you on your Cloud Native journey.
JCON Online 2021, International Java Community Conference, 07.10.21, Moritz Kammerer (@Moritz Kammerer, Expert Software Engineer at QAware).
== Please download slides in case they are blurred! ===
In his talk we have had a look at how Microservices can be developed with Micronaut. In our slides you can find out if it kept its promise.
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.
Are you a Java developer wondering what it means to have your application running in the cloud. This session will provide a peek into how the JVM is adapting to running in the cloud and what Java developers need to be aware to ensure they get the most of running in the cloud.
The session will pick an example spring application and tune it stage by stage at the end of which we have an application that is fully optimized and takes advantage of every aspect of the running in a cloud
Java Colombo Meetup on 22nd March 2018
Speaker: Isuru Perera, Technical Lead at WSO2
Flame graphs are a visualization of profiled software and it was developed by Brendan Gregg, an industry expert in computing performance and cloud computing. Finding out why CPUs are busy is an important task when troubleshooting performance issues and we often use a sampling profiler to see which code-paths are hot. However, a profiler will dump a lot of data with thousands of lines and it is not easy to go through all data. With Flame Graphs, we can identify the most frequent code-paths quickly and accurately. Basically, a Flame Graph can simply visualize the stack traces output of a sampling profiler.
There are many ways to profile Java applications and Java Flight Recorder (JFR) is a really good tool to profile a Java application with a very low overhead. I will show how we can generate a Flame Graph from a Java Flight Recording using the JFR Flame Graph tool (https://github.com/chrishantha/jfr-flame-graph) I developed.
Since Flame Graphs can visualize any stack profiles, we can also use a Linux system profiler (perf) and create a Java Mixed-Mode Flame Graph, which will show how much CPU time is spent in Java methods, system libraries and the kernel. We can troubleshoot performance issues related to high CPU usage easily with a flame graph showing profile information from both system code paths and Java code paths. I will discuss how we can use the -XX:+PreserveFramePointer option in JDK and the perf system profiler to generate a Java Mixed-mode flame graph.
Slides used for an internal training. This explains how to generate Flame Graphs using Java Flight Recorder dumps. There is also an example to use Linux "perf_events" to generate a Java Mixed-Mode Flame Graph.
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Isuru Perera
Guest lecture at Informatics Institute of Technology (http://www.iit.ac.lk/) on 04th December 2015.
This lecture covered following UML 2.5 Diagrams: Use-Case, Activity, Class, Object, Sequence, State Machine.
I also showed some tools I have used: UMLet and Astah Community. Astah is the main tool I used when I was studying.
Then I focused on OOP Concepts, Software Design Principles and some Design Patterns.
I have included links to all related content in the 32nd slide.
Presentation slides used at the 17th Java Colombo Meetup.
http://www.meetup.com/java-colombo/events/218658123/
This presentation explains the JMX Console & Java Flight Recorder (JFR) tools in Java Mission Control (JMC)
Using Java Mission Control & Java Flight RecorderIsuru Perera
This presentation explains the Java Mission Control (JMC) and how to use it.
Java Mission Control has two main tools: JMX Console & Java Flight Recorder (JFR). These are very powerful tools provided by the Oracle JDK.
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsIsuru Perera
Slides used for Apache Stratos (incubating) Fourth Hangout. Hangout video can be found at http://youtu.be/VtF9DVGKbTQ
Website: http://stratos.incubator.apache.org
Mailing List:
Subscribe: dev-subscribe@stratos.incubator.apache.org
Post (after subscription): dev@stratos.incubator.apache.org
Social Media:
Google+: https://plus.google.com/103515557134069849802
Twitter: https://twitter.com/ApacheStratos
Facebook: https://www.facebook.com/apache.stratos
LinkedIn: http://www.linkedin.com/groups?home=&gid=5131436
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Hivelance Technology
Cryptocurrency trading bots are computer programs designed to automate buying, selling, and managing cryptocurrency transactions. These bots utilize advanced algorithms and machine learning techniques to analyze market data, identify trading opportunities, and execute trades on behalf of their users. By automating the decision-making process, crypto trading bots can react to market changes faster than human traders
Hivelance, a leading provider of cryptocurrency trading bot development services, stands out as the premier choice for crypto traders and developers. Hivelance boasts a team of seasoned cryptocurrency experts and software engineers who deeply understand the crypto market and the latest trends in automated trading, Hivelance leverages the latest technologies and tools in the industry, including advanced AI and machine learning algorithms, to create highly efficient and adaptable crypto trading bots
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
Tim Combridge from Sensible Giraffe and Salesforce Ben presents some important tips that all developers should know when dealing with Flows in Salesforce.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
A Comprehensive Look at Generative AI in Retail App Testing.pdf
Software Profiling: Java Performance, Profiling and Flamegraphs
1. Software Profiling
Java Performance, Profiling and
Flamegraphs
M. Isuru Tharanga Chrishantha Perera, Technical Lead at WSO2, Co-organizer of Java Colombo Meetup
2. Software Profiling
● Profiling can help you to analyze the performance of your applications
and improve poorly performing sections in your code
3. Software Profiling
Wikipedia definition:
In software engineering, profiling ("program profiling", "software profiling") is a
form of dynamic program analysis that measures, for example, the space
(memory) or time complexity of a program, the usage of particular instructions, or
the frequency and duration of function calls. Most commonly, profiling
information serves to aid program optimization.
https://en.wikipedia.org/wiki/Profiling_(computer_programming)
3
4. Software Profiling
Wikipedia definition:
Profiling is achieved by instrumenting either the program source code or its
binary executable form using a tool called a profiler (or code profiler). Profilers
may use a number of different techniques, such as event-based, statistical,
instrumented, and simulation methods.
https://en.wikipedia.org/wiki/Profiling_(computer_programming)
4
6. Measuring Performance
6
We need a way to measure the performance:
● To understand how the system behaves
● To see performance improvements after doing any optimizations
There are two key performance metrics.
● Response Time/Latency
● Throughput
7. Throughput
Throughput measures the number of messages that a server processes
during a specific time interval (e.g. per second).
Throughput is calculated using the equation:
Throughput = number of requests / time to complete the requests
7
10. Tuning Java Applications
● We need to have a very high throughput and very low latency values.
● There is a tradeoff between throughput and latency. With more
concurrent users, the throughput increases, but the average latency will
also increase.
● Usually, you need to achieve maximum throughput while keeping latency
within some acceptable limit. For eg: you might choose maximum
throughput in a range where latency is less than 10ms
10
11. Throughput and Latency Graphs
11
Source: https://www.infoq.com/articles/Tuning-Java-Servers
12. Response Time/Latency Distribution
When measuring response time, it’s important to look at the the whole
distribution: min, max, avg, median, 75th percentile, 98th percentile, 99th
percentile etc.
12
13. Longtail latencies
When high percentiles have values much
greater than the average latency
Source:
https://engineering.linkedin.com/performanc
e/who-moved-my-99th-percentile-latency
13
14. Latency Numbers Every Programmer Should Know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
Read 1 MB sequentially from memory 250,000 ns 250 us
Round trip within same datacenter 500,000 ns 500 us
Read 1 MB sequentially from SSD* 1,000,000 ns 1,000 us 1 ms ~1GB/sec SSD, 4X memory
Disk seek 10,000,000 ns 10,000 us 10 ms 20x datacenter roundtrip
Read 1 MB sequentially from disk 20,000,000 ns 20,000 us 20 ms 80x memory, 20X SSD
Send packet CA->Netherlands->CA 150,000,000 ns 150,000 us 150 ms
14
15. Why do we need Profiling?
● Improve throughput (Maximizing the transactions processed per second)
● Improve latency (Minimizing the time taken to for each operation)
● Find performance bottlenecks
15
17. Java Garbage Collection
17
● Java automatically allocates memory for our applications and
automatically deallocates memory when certain objects are no longer
used.
● "Automatic Garbage Collection" is an important feature in Java.
● As Java Developers, we don't have to worry about memory
allocations/deallocations as Java takes care of the task to manage
memory for us
18. Marking and Sweeping Away Garbage
● GC works by first marking all used objects in the heap and then deleting
unused objects.
● GC also compacts the memory after deleting unreferenced objects to
make new memory allocations much easier and faster.
18
19. GC roots
● JVM references GC roots, which refer the application objects in a tree
structure. There are several kinds of GC Roots in Java.
○ Local Variables
○ Active Java Threads
○ Static variables
○ JNI references
● When the application can reach these GC roots, the whole tree is
reachable and GC can determine which objects are the live objects.
19
20. Java Heap Structure
Java Heap is divided into generations based on the object lifetime.
Following is the general structure of the Java Heap. (This is mostly dependent
on the type of collector).
20
21. Young Generation
● Young Generation usually has Eden and Survivor spaces.
● All new objects are allocated in Eden Space.
● When this fills up, a minor GC happens.
● Surviving objects are first moved to survivor spaces.
● When objects survives several minor GCs (tenuring threshold), the
relevant objects are eventually moved to the old generation.
21
22. Old Generation
● This stores long surviving objects.
● When this fills up, a major GC (full GC) happens.
● A major GC takes a longer time as it has to check all live objects.
22
23. Permanent Generation
● This has the metadata required by JVM.
● Classes and Methods are stored here.
● This space is included in a full GC.
23
24. Java 8 and PermGen
● Since Java 8, the permanent generation is not a part of heap.
● The metadata is now moved to native memory to an area called
“Metaspace”
● There is no limit for Metaspace by default
24
25. "Stop the World"
● For some events, JVM pauses all application threads. These are called
Stop-The-World (STW) pauses.
● GC Events also cause STW pauses.
● We can see application stopped time with GC logs.
25
26. GC Logging
There are JVM flags to log details for each GC. (Java 7 and 8)
-XX:+PrintGC - Print messages at garbage collection
-XX:+PrintGCDetails - Print more details at garbage collection
-XX:+PrintGCTimeStamps - Print timestamps at garbage collection
-XX:+PrintGCApplicationStoppedTime - Print the application GC stopped time
-XX:+PrintGCApplicationConcurrentTime - Print the application GC concurrent
time
The GCViewer is a great tool to view GC logs
26
27. Java Memory Usage
● Init - initial amount of memory that the JVM requests from the OS for
memory management during startup.
● Used - amount of memory currently used
● Committed - amount of memory that is guaranteed to be available for use
by the JVM
● Max - maximum amount of memory that can be used for memory
management.
27
29. JDK Tools and Utilities
● Basic Tools (java, javac, jar)
● Security Tools (jarsigner, keytool)
● Java Web Service Tools (wsimport, wsgen)
● Java Troubleshooting, Profiling, Monitoring and Management Tools (jcmd,
jconsole, jmc, jvisualvm)
29
30. Java Troubleshooting, Profiling, Monitoring and
Management Tools
● jcmd - JVM Diagnostic Commands tool
● jconsole - A JMX-compliant graphical tool for monitoring a Java
application
● jvisualvm – Provides detailed information about the Java application. It
provides CPU & Memory profiling, heap dump analysis, memory leak
detection etc.
● jmc – Tools to monitor and manage Java applications without introducing
performance overhead
30
33. Java Ergonomics and JVM Flags
● Java Virtual Machine can tune itself depending on the environment and
this smart tuning is referred to as Ergonomics.
● When tuning Java, it's important to know which values were used as
default for Garbage collector, Heap Sizes, Runtime Compiler by Java
Ergonomics
○ java -XshowSettings:vm -version
33
34. Printing Command Line Flags
We can use "-XX:+PrintCommandLineFlags" to print the command line flags
used by the JVM.
This is a useful flag to see the values selected by Java Ergonomics.
eg:
$ java -XX:+PrintCommandLineFlags -version
-XX:InitialHeapSize=126516992 -XX:MaxHeapSize=2024271872 -XX:+PrintCommandLineFlags
-XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
34
35. Printing Initial & Final JVM Flags
Use following command to see the default values
java -XX:+PrintFlagsInitial -version
Use following command to see the final values.
java -XX:+PrintFlagsFinal -version
The values modified manually or by Java Ergonomics are shown with “:=”
java -XX:+PrintFlagsFinal -version | grep ':='
35
36. Java Flags
Java has a lot of tuning options:
$ java -XX:+UnlockCommercialFeatures -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
-XX:+PrintFlagsFinal -version | head -n 10
[Global flags]
uintx AdaptiveSizeDecrementScaleFactor = 4 {product}
uintx AdaptiveSizeMajorGCDecayTimeScale = 10 {product}
uintx AdaptiveSizePausePolicy = 0 {product}
uintx AdaptiveSizePolicyCollectionCostMargin = 50 {product}
uintx AdaptiveSizePolicyInitializingSteps = 20 {product}
uintx AdaptiveSizePolicyOutputInterval = 0 {product}
uintx AdaptiveSizePolicyWeight = 10 {product}
uintx AdaptiveSizeThroughPutPolicy = 0 {product}
uintx AdaptiveTimeWeight = 25 {product}
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
36
39. Other Java Profiling Tools
● JProfiler - A commercially licensed Java profiling tool developed by
ej-technologies
● Honest Profiler - A sampling JVM profiler without the safepoint sample
bias
● Async Profiler - Sampling CPU and HEAP profiler for Java featuring
AsyncGetCallTrace + perf_events
40. Java Profiling Tools
Survey by RebelLabs in 2016: http://pages.zeroturnaround.com/RebelLabs-Developer-Productivity-Report-2016.html
41. Attitude toward performance work
Survey by RebelLabs in 2017:
https://zeroturnaround.com/rebellabs/developer-productivity-survey-2017/
42. Measuring Methods for CPU Profiling
● Sampling: Monitor running code externally and check which code is
executed
● Instrumentation: Include measurement code into the real code
45. Sampling vs. Instrumentation
Sampling
Overhead depends on the sampling
interval
Stable Overhead
Can see execution hotspots
Can miss methods, which returns
faster than the sampling interval.
Can discover unknown code
Instrumentation
Precise measurement for execution
times
No stable overhead
More data to process
45
46. Sampling vs. Instrumentation
46
● Java VisualVM uses both sampling and instrumentation
● Java Flight Recorder uses sampling for hot methods
● JProfiler supports both sampling and instrumentation
47. How Profilers Work?
● Generic profilers rely on the JVMTI spec
● JVMTI offers only safepoint sampling stack trace collection options
● Some profilers use AsyncGetCallTrace method, which is an OpenJDK
internal API call to facilitate non-safepoint collection of stack traces
48. Safepoints
● A safepoint is a moment in time when a thread’s data, its internal state
and representation in the JVM are, well, safe for observation by other
threads in the JVM.
○ Between every 2 bytecodes (interpreter mode)
○ Backedge of non-’counted’ loops
○ Method exit
○ JNI call exit
49. Problems with Profiling
● Runtime Overhead
● Interpretation of the results can be difficult
● Identifying the "crucial“ parts of the software
● Identifying potential performance improvements
49
50. Profiling Applications with Java VisualVM
50
● CPU Profiling: Profile the performance of the application.
● Memory Profiling: Analyze the memory usage of the application.
51. Java Mission Control
● A set of powerful tools running on the Oracle JDK to monitor and manage
Java applications
● Free for development use (Oracle Binary Code License)
● Available in JDK since Java 7 update 40
● Supports Plugins
● Two main tools
○ JMX Console
○ Java Flight Recorder
51
53. Java Flight Recorder (JFR)
● A profiling and event collection framework built into the Oracle JDK
● Gather low level information about the JVM and application behaviour
without performance impact (less than 2%)
● Always on Profiling in Production Environments
● Engine was released with Java 7 update 4
● Commercial feature in Oracle JDK
● A main tool in Java Mission Control (since Java 7 update 40)
54. JFR Events
JFR collects data about events.
JFR collects information about three types of events:
1. Instant events – Events occurring instantly
2. Sample (Requestable) events – Events with a user configurable period to
provide a sample of system activity
3. Duration events – Events taking some time to occur. The event has a start
and end time. You can set a threshold.
54
55. Java Flight Recorder Architecture
JFR is comprised of the following components:
1. JFR runtime - The recording engine inside the JVM that produces the
recordings.
2. Flight Recorder plugin for Java Mission Control (JMC)
55
56. Enabling Java Flight Recorder
Since JFR is a commercial feature, we must unlock commercial features before
trying to run JFR.
So, you need to have following arguments.
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
56
57. Dynamically enabling JFR
If you are using Java 8 update 40 (8u40) or later, you can now dynamically
enable JFR.
This is useful as we don’t need to restart the server.
Sometimes a restart solves the problem anyway. :) But that’s just temporary
and it’s always good to analyze the root cause of the problem.
57
58. Improving the accuracy of JFR Method Profiler
An important feature of JFR Method Profiler is that it does not require threads
to be at safe points in order for stacks to be sampled.
Generally, the stacks will only be walked at safe points.
HotSpot JVM doesn’t provide metadata for non-safe point parts of the code.
Use following to improve the accuracy.
-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints
58
59. JFR Event Settings
There are two event settings by default in Oracle JDK.
Files are in $JAVA_HOME/jre/lib/jfr
1. Continuous - default.jfc
2. Profiling - profile.jfc
59
60. JFR Recording Types
Time Fixed Recordings
● Fixed duration
● The recording will be opened automatically in JMC at the end (If the
recording was started by JMC)
Continuous Recordings
● No end time
● Must be explicitly dumped
60
61. Running Java Flight Recorder
There are few ways we can run JFR.
1. Using the JFR plugin in JMC
2. Using the command line
3. Using the Diagnostic Command
61
62. Running Java Flight Recorder
You can run multiple recordings concurrently and have different settings for
each recording.
However, the JFR runtime will use same buffers and resulting recording
contains the union of all events for all recordings active at that particular time.
This means that we might get more than we asked for. (but not less)
62
63. Running JFR from JMC
Right click on JVM and select “Start Flight Recording”
Select the type of recording: Time fixed / Continuous
Select the “Event Settings” template
Modify the event options for the selected flight recording template (Optional)
Modify the event details (Optional)
63
64. Running JFR from Command Line
To produce a Flight Recording from the command line, you can use “-
XX:StartFlightRecording” option. Eg:
-XX:StartFlightRecording=delay=20s,duration=60s,name=Test,fi
lename=recording.jfr,settings=profile
Use following to change log level
-XX:FlightRecorderOptions=loglevel=info
64
65. The Default Recording (Continuous Recording)
You can also start a continuous recording from the command line using
-XX:FlightRecorderOptions.
-XX:FlightRecorderOptions=defaultrecording=true,disk=true,re
pository=/tmp,maxage=6h,settings=default
Default recording can be dumped on exit. Only the default recording can be
used with the dumponexit and dumponexitpath parameters
-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=t
rue,dumponexitpath=/tmp/dumponexit.jfr
65
66. Running JFR using Diagnostic Commands
The command “jcmd” can be used.
Start Recording Example:
jcmd <pid> JFR.start delay=20s duration=60s name=MyRecording
filename=/tmp/recording.jfr settings=profile
Check recording
jcmd <pid> JFR.check
Dump Recording
jcmd <pid> JFR.dump filename=/tmp/dump.jfr name=MyRecording
66
67. Analyzing Flight Recordings
JFR runtime engine dumps recorded data to files with *.jfr extension
These binary files can be viewed from JMC
There are tab groups showing certain aspects of the JVM and the Java
application runtime such as Memory, Threads, I/O etc.
67
68. JFR Tab Groups
● General – Details of the JVM, the system, and the recording.
● Memory - Information about memory & garbage collection.
● Code - Information about methods, exceptions, compilations, and class
loading.
● Threads - Information about threads and locks.
● I/O: Information about file and socket I/O.
● System: Information about environment
● Events: Information about the event types in the recording
68
69. Allocation Profiling
● Finding out where the allocations happen in your application.
● If there are more allocations, JVM will have to run garbage collection more
often
69
70. Sample applications
Let’s try some sample applications
https://github.com/chrishantha/sample-java-programs
● Hot Methods Application
● High CPU Application
● Allocations Application
● Latencies Application
70
72. Java Just-In-Time (JIT) compiler
Java code is usually compiled into platform independent bytecode (class files)
The JVM is able to load the class files and execute the Java bytecode via the
Java interpreter.
Even though this bytecode is usually interpreted, it might also be compiled
into native machine code using the JVM's Just-In-Time (JIT) compiler.
72
73. Java Just-In-Time (JIT) compiler
Unlike the normal compiler, the JIT compiler compiles the code (bytecode)
only when required. With JIT compiler, the JVM monitors the methods
executed by the interpreter and identifies the “hot methods” for compilation.
After identifying the Java method calls, the JVM compiles the bytecode into a
more efficient native code.
In this way, the JVM can avoid interpreting a method each time during the
execution and thereby improves the runtime performance of the application.
73
75. JITWatch
The JITWatch tool can analyze the compilation logs generated with the
“-XX:+LogCompilation” flag.
The logs generated by LogCompilation are XML-based and has lot of
information related to JIT compilation. Hence these files are very large.
https://github.com/AdoptOpenJDK/jitwatch
75
76. Premature Optimizations
“We should forget about small efficiencies, say
about 97% of the time: premature
optimization is the root of all evil. Yet we
should not pass up our opportunities in that
critical 3%."
- Donald Knuth
76
Image is from: http://wiki.c2.com/?DonKnuth
77. Premature Optimizations
● You shouldn’t:
○ Manually inline methods.
○ Write code directly in bytecode.
○ Allocate public variables and use them as global memory throughout an application.
77
79. Flame Graphs
● “Flame graphs are a visualization of profiled software, allowing the most
frequent code-paths to be identified quickly and accurately.”
● Developed by Brendan Gregg, an industry expert in computing
performance and cloud computing.
● Flame Graphs can be generated using
https://github.com/brendangregg/FlameGraph
○ This creates an interactive SVG
http://www.brendangregg.com/flamegraphs.html
81. Flame Graph: Definition
● The x-axis shows the stack profile population, sorted alphabetically
● The y-axis shows stack depth
○ The top edge shows what is on-CPU, and beneath it is its ancestry
● Each rectangle represents a stack frame.
● Box width is proportional to the total time a function was profiled directly
or its children were profiled
● The colors are usually not significant, picked randomly to differentiate
frames.
82. Types of Flame Graphs
● CPU - see which code-paths are hot (busy on-CPU)
● Memory - Memory Leak (and Growth)
● Off-CPU - Time spent by processes and threads when they are not
running on-CPU
● Hot/Cold - both CPU and Off-CPU
● Differential - compare before and after flame graphs
83. Why do we need Flame Graphs?
● Finding out why CPUs are busy is an important task when troubleshooting
performance issues
● Can use a sampling profiler to see which code-paths are hot.
● Usually a profiler will dump a lot of data with thousands of lines
● Flame Graph can simply visualize the stack traces output of a sampling
profiler.
84. Naive Profiling: Taking Thread Dumps
● “A thread dump is a snapshot of the state of all threads that are part of
the process.”
● The state of the thread is represented with a stack trace.
● A thread can be in only one state at a given point in time.
● You can take thread dumps at regular intervals to do “Naive Java Profiling”
85. Sample program to profile
● Get Sample “highcpu” program from
https://github.com/chrishantha/sample-java-programs
● mvn clean install
● cd highcpu
● java -jar target/highcpu.jar --help
88. Flame Graph with Thread Dumps (Without Thread
Names) Top edge shows the methods
on-CPU directly
Visually compare lengths
AncestryCode path
Branches
89. Flame Graphs with Java Flight Recordings
● We can generate CPU Flame Graphs from a Java Flight Recording
● Program is available at GitHub:
https://github.com/chrishantha/jfr-flame-graph
● The program uses the (unsupported) JMC Parser
90. Generating a Flame Graph using JFR dump
● JFR has Method Profiling Samples
○ You can view those in “Hot Methods” and “Call Tree” tabs
● A Flame Graph can be generated using these Method Profilings Samples
● Use following to improve the accuracy of JFR Method Profiler.
● -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints
91. Profiling the Sample Program
● Get a Profiling Recording
○ java -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
-XX:StartFlightRecording=delay=10s,duration=1m,name=Profiling,filena
me=highcpu_profiling.jfr,settings=profile -jar target/highcpu.jar
--hashing-algo SHA-512 --hashing-workers 20 --math-workers 10
92. Profiling a Sample Program
Get Sample “highcpu” program from
https://github.com/chrishantha/sample-java-programs
Get a Profiling Recording
java -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
-XX:StartFlightRecording=delay=5s,duration=1m,name=Profiling,filename=highcp
u_profiling.jfr,settings=profile -jar target/highcpu.jar
Using jfr-flame-graph
create_flamegraph.sh -f highcpu_profiling.jfr -i > flamegraph.svg
92
95. Java Mixed-Mode Flame Graphs
● With Java Profilers, we can get information about Java process only.
● However with Java Mixed-Mode Flame Graphs, we can see how much CPU
time is spent in Java methods, system libraries and the kernel.
● Mixed-mode means that the Flame Graph shows profile information from
both system code paths and Java code paths.
100. Preserving Frame Pointers in JVM
● Run java program with the JVM flag "-XX:+PreserveFramePointer"
○ java -XX:+PreserveFramePointer -jar target/highcpu.jar --hashing-algo SHA-512
--hashing-workers 20 --math-workers 10 --exit-timeout 300
● This flag is working only on JDK 8 update 60 and above.
● Some frames may be still missing when compared to Flame Graphs
generated from JFR or jstack due to “inlining”.
● Can reduced the amount of inlining if you need to see more frames in the
profile.
○ For example, -XX:InlineSmallCode=500
101. Preserving Frame Pointers in JVM
Run java program with the JVM flag "-XX:+PreserveFramePointer"
java -XX:+PreserveFramePointer -jar target/highcpu.jar
--exit-timeout 600
This flag is working only on JDK 8 update 60 and above.
101
102. How to generate Java symbol table
● Use a java agent to generate method mappings to use with the linux
`perf` tool
○ Clone & Build https://github.com/jvm-profiling-tools/perf-map-agent
● Create symbol map
○ ./create-java-perf-map.sh `pgrep -f highcpu`
● You can also use “jmaps” tool in FlameGraph repository to create symbol
files for all Java processes.
○ export AGENT_HOME=/home/isuru/performance/git-projects/perf-map-agent
○ sudo perf record -F 499 -a -g -- sleep 30;sudo -E $FLAMEGRAPH_DIR/jmaps
● Let Java to “warm-up” before getting symbol maps.
106. Java Mixed-Mode Flame Graph
● Helps to understand Java CPU Usage
● With Flame Graphs, we can see both java and system profiles
● Can profile GC as well
107. Linux Profiling
We can use “perf”, which is a Linux Profiler with performance counters to
profile system code paths.
Linux perf command is also called perf_events
Some perf commands:
perf stat: obtain event counts
perf record: record events for later reporting
perf report: break down events by process, function, etc.
perf top: see live event count
107
108. Does profiling matter?
● Yes!
● Most of the performance issues are in the application code.
● Early performance testing is key. Fix problems while developing.
108