Discover the Top 5 Java Performance Problems in our presentation. Learn about common issues in Java coding and how to fix them. This guide helps you make your Java applications run better and faster.
Size: 3.54 MB
Language: en
Added: Apr 24, 2024
Slides: 47 pages
Slide Content
Top 5 Java Performance Problems Ram Lakshmanan Architect yCrash
Top 5 Production Performance problems What you will be learning? 2 Real case studies with Real data Most efficient way to troubleshoot these problems
Garbage Collection 3
What is Garbage? HTTP Request Objects Memory Garbage 4
5 3-4 Decades ago Developer Writes code to Manually evict Garbage JVM Automatically evicts Garbage Now How are objects Garbage Collected? Evolution: Manual -> Automatic
6 Automatic GC sounds good right? Yes, but for GC pauses CPU consumption
How to analyze GC Log? https://developer.ibm.com/javasdk/tools/ IBM GC & Memory visualizer GCeasy yCrash https://gceasy.io/ Google Garbage cat ( cms ) https://code.google.com/archive/a/eclipselabs.org/p/garbagecat HP Jmeter https://h20392.www2.hpe.com/portal/swdepot/displayProductInfo.do?productNumber=HPJMETER 03 02 01 05 04 https://ycrash.io/ 9
10 Case Study Long GC Pauses in Top Cloud hosting Provider https://blog.gceasy.io/2022/03/04/garbage-collection-tuning-success-story-reducing-young-gen-size/
How does 96% GC Throughput sound? 1 day = 1440 Minutes (i.e., 24 hours x 60 minutes) 96% GC Throughput means app pausing for 57.6 minutes/day 11 What is GC Throughput? Amount of time application spends in processing customer transactions vs Amount of time application spends in processing garbage collection activity
13 More case studies Uber Saves Millions of $ https://blog.gceasy.io/2022/03/04/garbage-collection-tuning-success-story-reducing-young-gen-size/ Large Automobile Manufacturer Improves Response Time https://blog.gceasy.io/2022/03/04/garbage-collection-tuning-success-story-reducing-young-gen-size/ CloudBees (Jenkins Parent company) optimizes https://blog.gceasy.io/2019/08/01/cloudbees-gc-performance-optimized-with-gceasy/ Oracle optimizes App performance by tuning GC https://blog.gceasy.io/2022/12/06/oracle-architect-optimizes-performance-using-gceasy/
14 Large SaaS company CEO’s tweet
15 How to tune GC performance? Free Video: https://www.youtube.com/watch?v=6G0E4O5yxks Online Training: https://ycrash.io/java-performance-training
16 Backend Slowdown
Application Architecture JDBC SOAP MainFrame REST Server Thread Pool Application Server HTTP(S) request 17
Application Architecture JDBC SOAP MainFrame REST Server Thread Pool Application Server HTTP(S) request 18
1 2 3 1 Timestamp at which thread dump was triggered 2 JVM Version info 3 Thread Details - <<details in following slides>> 20
1 2 3 4 5 6 7 1 Thread Name - InvoiceThread-A996 2 Priority - Can have values from 1 to 10 3 Thread Id - 0x00002b7cfc6fb000 – Unique ID assigned by JVM. It's returned by calling the Thread.getId () method. 4 Native Id - 0x4479 - This ID is highly platform dependent. On Linux, it's the pid of the thread. On Windows, it's simply the OS-level thread ID within a process. On Mac OS X, it is said to be the native pthread_t value. 5 Address space - 0x00002b7d17ab8000 - 6 Thread State - RUNNABLE 7 Stack trace - 21
How to analyze Thread dump? https://www.ibm.com/support/pages/ibm-thread-and-monitor-dump-analyzer-java-tmda IBM TDMA FastThread https://fastthread.io/ 03 02 https://tinyurl.com/wq95weo Sample thread report yCrash https://ycrash.io/ 01 22
23 Case Study Backend Slowdown in a Major Financial Institution in N. America Analysis Report: https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDcvMzEvdGhyZWFkX2thc3RsZV8yNjA3MjIudHh0LS03LTMwLTMzLS0xNi0zMy0zNg==&&s=t What’s typically reported in APM? AWS Cloud watch + yCrash = Monitoring + RCA – yCrash
OutOfMemoryError 24
25 Memory Leak Program Open Source app to simulate Performance Problems BuggyApp
MemoryLeakDemo Object1 Object2 MapManager Key1 Large String…1 Key2 Large String…2 key3 Large String…3 : : KeyN Large String…N myMap
27 Memory of Healthy Application - Full Garbage Collection Event
28 Acute Memory Leak - Full Garbage Collection Event
Ram Lakshmanan [email protected] @tier1app https://www.linkedin.com/company/ycrash This deck will be published in: https://blog.heaphero.io If you want to learn more … 47 THANK YOU FRIENDS