SlideShare a Scribd company logo
1 of 18
Java Performance
Chapter 6
1
Saurav Basu
6/3/2020
Organization
1. Strategies, Approaches, and Methodologies
2. Operating System Performance Monitoring
3. JVM Overview
4. JVM Performance Monitoring
5. Java Application Profiling
6. Java Application Profiling - Tips & Tricks
7. Tuning the JVM - Step by Step
8. Benchmarking Java Applications
9. Benchmarking Multitiered Applications
10. Web Application Performance
11. Web Services Performance
12. Java Persistence & Enterprise Java Beans Performance
2
Java Application Profiling: Tips and Tricks
● System or Kernel CPU
● Lock Contention
● Volatile Usage
● Data Structure Resizing
● Increasing Parallelism
● Other Tips
3
Strategies
Java Application Profiling: Tips and Tricks
● System or Kernel CPU
● Lock Contention
● Volatile Usage
● Data Structure Resizing
● Increasing Parallelism
● Other Tips
4
Strategies
Java Application Profiling: Tips and Tricks
5
Strategies : Kernel CPU
Java Application Profiling: Tips and Tricks
6
Strategies : Kernel CPU
Java Application Profiling: Tips and Tricks
7
Strategies : Kernel CPU
CPU usage
Java Application Profiling: Tips and Tricks
8
Strategies : Kernel CPU
Java NIO (NonBlocking)
Java Application Profiling: Tips and Tricks
● System or Kernel CPU
● Lock Contention
● Volatile Usage
● Data Structure Resizing
● Increasing Parallelism
● Other Tips
9
Strategies
Java Application Profiling: Tips and Tricks
10
Strategies:Lock Contention
Java Application Profiling: Tips and Tricks
● System or Kernel CPU
● Lock Contention
● Volatile Usage
● Data Structure Resizing
● Increasing Parallelism
● Other Tips
11
Strategies
Java Application Profiling: Tips and Tricks
12
Strategies: Volatile Usage
Java Application Profiling: Tips and Tricks
13
Strategies
Java Application Profiling: Tips and Tricks
● System or Kernel CPU
● Lock Contention
● Volatile Usage
● Data Structure Resizing
● Increasing Parallelism
● Other Tips
14
Strategies
Java Application Profiling: Tips and Tricks
15
Strategies: Inc rease Parallelism
Java Application Profiling: Tips and Tricks
16
Strategies: Inc rease Parallelism
Idle Threads
Java Application Profiling: Tips and Tricks
● System or Kernel CPU
● Lock Contention
● Volatile Usage
● Data Structure Resizing
● Increasing Parallelism
● Other Tips
17
Strategies
Java Application Profiling: Tips and Tricks
18
Strategies: Other Tips

More Related Content

Similar to JavaPerformanceChapter_6

Java Tuning White Paper
Java Tuning White PaperJava Tuning White Paper
Java Tuning White Paper
white paper
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7
Vinay H G
 
Advanced Application Lifecycle Managment
Advanced Application Lifecycle ManagmentAdvanced Application Lifecycle Managment
Advanced Application Lifecycle Managment
Salesforce Developers
 
An Automation Framework That Really Works
An Automation Framework That Really WorksAn Automation Framework That Really Works
An Automation Framework That Really Works
Basivi Reddy Junna
 
Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014
OSSCube
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
Atul Pant
 
75.bug tracking for improving software quality & reliability
75.bug  tracking  for improving software quality & reliability75.bug  tracking  for improving software quality & reliability
75.bug tracking for improving software quality & reliability
happiness09
 

Similar to JavaPerformanceChapter_6 (20)

Java Tuning White Paper
Java Tuning White PaperJava Tuning White Paper
Java Tuning White Paper
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7
 
Presto Summit 2018 - 07 - Lyft
Presto Summit 2018 - 07 - LyftPresto Summit 2018 - 07 - Lyft
Presto Summit 2018 - 07 - Lyft
 
Проблемы с производительностью приложений на AngularJS и способы их решения
Проблемы с производительностью приложений на AngularJS и способы их решенияПроблемы с производительностью приложений на AngularJS и способы их решения
Проблемы с производительностью приложений на AngularJS и способы их решения
 
Advanced Application Lifecycle Managment
Advanced Application Lifecycle ManagmentAdvanced Application Lifecycle Managment
Advanced Application Lifecycle Managment
 
Change management in hybrid landscapes
Change management in hybrid landscapesChange management in hybrid landscapes
Change management in hybrid landscapes
 
An Automation Framework That Really Works
An Automation Framework That Really WorksAn Automation Framework That Really Works
An Automation Framework That Really Works
 
Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014
 
Netherlands Tech Tour - 06 MySQL Enterprise Monitor
Netherlands Tech Tour - 06 MySQL Enterprise MonitorNetherlands Tech Tour - 06 MySQL Enterprise Monitor
Netherlands Tech Tour - 06 MySQL Enterprise Monitor
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
 
Test automation Frame Works
Test automation Frame WorksTest automation Frame Works
Test automation Frame Works
 
Jee performance tuning existing applications
Jee performance tuning existing applicationsJee performance tuning existing applications
Jee performance tuning existing applications
 
Application Performance Tuning Techniques
Application Performance Tuning TechniquesApplication Performance Tuning Techniques
Application Performance Tuning Techniques
 
VARUN GULATI CV1
VARUN GULATI CV1VARUN GULATI CV1
VARUN GULATI CV1
 
75.bug tracking for improving software quality & reliability
75.bug  tracking  for improving software quality & reliability75.bug  tracking  for improving software quality & reliability
75.bug tracking for improving software quality & reliability
 
Интеграция решения по тестированию производительности в существующий фреймвор...
Интеграция решения по тестированию производительности в существующий фреймвор...Интеграция решения по тестированию производительности в существующий фреймвор...
Интеграция решения по тестированию производительности в существующий фреймвор...
 
Grails
GrailsGrails
Grails
 
GWT and Angular - Relatives or Foes
GWT and Angular - Relatives or FoesGWT and Angular - Relatives or Foes
GWT and Angular - Relatives or Foes
 
Performance Tips and Tricks: Java EE, Java Persistence API and JavaServer Faces
Performance Tips and Tricks: Java EE, Java Persistence API and JavaServer FacesPerformance Tips and Tricks: Java EE, Java Persistence API and JavaServer Faces
Performance Tips and Tricks: Java EE, Java Persistence API and JavaServer Faces
 

More from Saurav Basu (9)

JavaPerformanceChapter_12
JavaPerformanceChapter_12JavaPerformanceChapter_12
JavaPerformanceChapter_12
 
JavaPerformanceChapter_11
JavaPerformanceChapter_11JavaPerformanceChapter_11
JavaPerformanceChapter_11
 
JavaPerformanceChapter_8
JavaPerformanceChapter_8JavaPerformanceChapter_8
JavaPerformanceChapter_8
 
Java PerformanceChapter_7
Java PerformanceChapter_7Java PerformanceChapter_7
Java PerformanceChapter_7
 
JavaPerformanceChapter_5
JavaPerformanceChapter_5JavaPerformanceChapter_5
JavaPerformanceChapter_5
 
JavaPerformanceChapter_4
JavaPerformanceChapter_4JavaPerformanceChapter_4
JavaPerformanceChapter_4
 
JavaPerformanceChapter_3
JavaPerformanceChapter_3JavaPerformanceChapter_3
JavaPerformanceChapter_3
 
JavaPerformanceChapter_2
JavaPerformanceChapter_2JavaPerformanceChapter_2
JavaPerformanceChapter_2
 
Application Deployment Architecture
Application Deployment ArchitectureApplication Deployment Architecture
Application Deployment Architecture
 

Recently uploaded

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

JavaPerformanceChapter_6

Editor's Notes

  1. Next we will talk about Java Application Profiling Tips and Tricks
  2. Examples of using tools to solve performance issues. General Optimization opportunity falls in to one of the following categories
  3. Lets first look at System CPU
  4. Example of function hotspot showing 65% of total cpu attributed to FIleOutputStream.write
  5. Use of BufferedOutPutStream with a default size inplace of FIleOutputStream. BufferedOutputStream can also be specified With a defsault size If an explicit size is specified, consider a size that is a multiple of the operating systems page size since operating systems efficiently fetch memory that are multiples of the operating system page size
  6. Reduced cpu utilization from 45.182 to 6.655 sec after this change
  7. Use of Java NIO can also improve performance in cases where large number of connections are open (ex chat application)
  8. Next we will look at lock contention
  9. Trace the time taken by __lwp_cond_wait and _lwp_park methods
  10. Next we will look at use of volatile fields
  11. Reduce False sharing occurrence due to use of update of volatile fields in code. In this case an update to a field in cache of core0 by causes cache reload on core1
  12. In this example 11.4% of all char[] allocation result from call of expandCapacity method of StringBuilder. This suggests allocating a default size could improve performance overhead of reallocation of char[] for each char resize.
  13. Next we will look at increasing parallelism
  14. Reduce lock contention by identifying parallelism in task. 2 types of parallelism : task & data parallelism Difference between DataParallelism (1-4) and Task Parallelism(5-9) Same task are performed on different subsets of same data. Synchronous computation is performed. As there is only one execution thread operating on all sets of data, so the speedup is more Amount of parallelization is proportional to the input size Different task are performed on the same or different data Asynchronous computation is performed As each processor will execute a different thread or process on the same or different set of data, so speedup is less Amount of parallelization is proportional to the number of independent tasks is performed It is designed for optimum load balance on multiprocessor system
  15. Timeline view of Solaris Studio 16-64 only thread 1 is active Investigate Paralellizabilirty of thread1
  16. Next we will look at other tips
  17. Filter view to observe timeline of interest