SlideShare a Scribd company logo
The Right Pill for JRuby
Memory and Thread Issues:
Eclipse Memory Analyzer




Vladimir Pavlov
Dimitar Giormov             Memory Analyzer
SAP Labs Bulgaria
AGENDA



         Ruby and JRuby
         The Headaches
         Eclipse Memory Analyzer
         The Pill
         Further Enhancements
         Q&A




© SAP 2010 / Page 2
DISCLAIMER
         We are not experts in Ruby/JRuby
              Although we have (some) experience with those
         However, we have quite a lot of experience and track in Java and Eclipse
              Or at least we think so ;-)




© SAP 2010 / Page 3
RUBY AND JRUBY
         Ruby is…
              Dynamic scripting language
              Object-oriented
              Focus on simplicity and productivity
              Elegant syntax, natural to read and easy to write


         JRuby is…
              100% Java implementation of the Ruby programming language
              Interpreter running atop the JVM
              Generating Java bytecode (JIT compilation mode)
              Tight integration with Java




© SAP 2010 / Page 4
THE HEADACHES
         Memory leaks
              Hard to debug and find the root cause
              Eventually lead to OOM errors


           Brings your system down
           Often not reproducible


         Thread issues
              Deadlocks
              Exhausted threads
              Waiting for an external resource – e.g. DB connection


           Application does not respond
           Whole system hangs



© SAP 2010 / Page 5
THE HEADACHES – AGGRAVATED
    Adding JRuby into the picture…




© SAP 2010 / Page 6
ECLIPSE MEMORY ANALYZER
         Eclipse Memory Analyzer (MAT) is…
              Java heap analyzer                                             Memory Analyzer
              Helps find memory leaks and reduce memory consumption
              Query heap dumps via OQL
              Multi-Gigabyte Java Heap Dumps Are Nothing to Fear Now
              Soooo much faster than other tools, e.g. jhat
              Very little memory “overhead” for processing heap dumps (again – cf. jhat)
              Provides a report with automatically extracted leak suspects
              Supports Sun, SAP, HP, IBM JDKs 1.4.2 and above
              Could also process thread dumps and correlate data to provide additional details
              Highly extensible
              Open source




© SAP 2010 / Page 7
THE PILL
     JRuby extension plugin for Eclipse Memory Analyzer
     Plugs into the heap dump processing by means of extension points
          <extension point="org.eclipse.mat.api.requestResolver">
                  <resolver
                      impl="org.eclipse.mat.extension.jruby.RubyStacktraceDumper">
                  </resolver>
                  <resolver
                      impl="org.eclipse.mat.extension.jruby.JRubyScriptResolver">
                  </resolver>
          </extension>
         Looks for specific JRuby implementation objects in the heap
          @Subject("org.jruby.internal.runtime.RubyRunnable")
          @Subject("org.jruby.runtime.ThreadContext")
     Produces readable Ruby stack traces
     Memory Analyzer 1.1 snapshot/preview download




© SAP 2010 / Page 8
FURTHER ENHANCEMENTS
         Producing hybrid Ruby/Java stack traces
         Thread dumps analysis
         Specific use case information, e.g. session data
         Automation
         …

         Feedback…
              Ideas…
                Contributions…

                                           … always welcome! 
                         https://dev.eclipse.org/mailman/listinfo/mat-dev
          http://www.eclipse.org/projects/project_summary.php?projectid=tools.mat




© SAP 2010 / Page 9
© SAP 2010 / Page 10
THANK YOU!




Memory Analyzer




                           in: vpavlov
                         t: @giormov

More Related Content

PPT
Using and Extending Memory Analyzer into Uncharted Waters
PPTX
Debugging and Profiling Cloud Apps? Sure, You Can Do It Now!
PDF
SAP HANA Cloud Platform CodeJam
PPTX
SAP HANA Cloud Platform CodeJam 2015
PDF
Web Sphere Problem Determination Ext
PPT
Javaforum looking into the memory
PPTX
Application Profiling for Memory and Performance
PDF
[BGOUG] Memory analyzer
Using and Extending Memory Analyzer into Uncharted Waters
Debugging and Profiling Cloud Apps? Sure, You Can Do It Now!
SAP HANA Cloud Platform CodeJam
SAP HANA Cloud Platform CodeJam 2015
Web Sphere Problem Determination Ext
Javaforum looking into the memory
Application Profiling for Memory and Performance
[BGOUG] Memory analyzer

Similar to The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer (20)

PDF
JRuby - The Perfect Alternative
PDF
Debugging Java from Dumps
PPT
Eclipse Memory Analyzer
PDF
Tuning Android Applications (Part One)
PPT
Practical lessons in memory analysis
PPT
Eclipse Memory Analyzer - More Than Just a Heap Walker
PDF
Application Profiling for Memory and Performance
PDF
Hp java heap dump analysis Workshop
PDF
Ps ts 4118-304118_230-1_fin_v1
PPT
2007 SAPTech Ed
PDF
Jud con presentation_brazil
PPTX
EclipseMAT
PDF
What Your Jvm Has Been Trying To Tell You
PDF
Who Took The Cookie From The Cookie Jar?
PDF
Tools and Tips to Diagnose Performance Issues
PPTX
Exploring Java Heap Dumps (Oracle Code One 2018)
PPT
Java Performance Monitoring & Tuning
PPT
Distilling Dumps: a Guide to Using and Extending Memory Analyzer
PPTX
Lab: JVM Production Debugging 101
PPTX
Java performance tuning
JRuby - The Perfect Alternative
Debugging Java from Dumps
Eclipse Memory Analyzer
Tuning Android Applications (Part One)
Practical lessons in memory analysis
Eclipse Memory Analyzer - More Than Just a Heap Walker
Application Profiling for Memory and Performance
Hp java heap dump analysis Workshop
Ps ts 4118-304118_230-1_fin_v1
2007 SAPTech Ed
Jud con presentation_brazil
EclipseMAT
What Your Jvm Has Been Trying To Tell You
Who Took The Cookie From The Cookie Jar?
Tools and Tips to Diagnose Performance Issues
Exploring Java Heap Dumps (Oracle Code One 2018)
Java Performance Monitoring & Tuning
Distilling Dumps: a Guide to Using and Extending Memory Analyzer
Lab: JVM Production Debugging 101
Java performance tuning
Ad

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Machine Learning_overview_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
MYSQL Presentation for SQL database connectivity
PDF
cuic standard and advanced reporting.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation theory and applications.pdf
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
Machine Learning_overview_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
MYSQL Presentation for SQL database connectivity
cuic standard and advanced reporting.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
sap open course for s4hana steps from ECC to s4
Spectroscopy.pptx food analysis technology
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Ad

The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer

  • 1. The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer Vladimir Pavlov Dimitar Giormov Memory Analyzer SAP Labs Bulgaria
  • 2. AGENDA  Ruby and JRuby  The Headaches  Eclipse Memory Analyzer  The Pill  Further Enhancements  Q&A © SAP 2010 / Page 2
  • 3. DISCLAIMER  We are not experts in Ruby/JRuby  Although we have (some) experience with those  However, we have quite a lot of experience and track in Java and Eclipse  Or at least we think so ;-) © SAP 2010 / Page 3
  • 4. RUBY AND JRUBY  Ruby is…  Dynamic scripting language  Object-oriented  Focus on simplicity and productivity  Elegant syntax, natural to read and easy to write  JRuby is…  100% Java implementation of the Ruby programming language  Interpreter running atop the JVM  Generating Java bytecode (JIT compilation mode)  Tight integration with Java © SAP 2010 / Page 4
  • 5. THE HEADACHES  Memory leaks  Hard to debug and find the root cause  Eventually lead to OOM errors  Brings your system down  Often not reproducible  Thread issues  Deadlocks  Exhausted threads  Waiting for an external resource – e.g. DB connection  Application does not respond  Whole system hangs © SAP 2010 / Page 5
  • 6. THE HEADACHES – AGGRAVATED Adding JRuby into the picture… © SAP 2010 / Page 6
  • 7. ECLIPSE MEMORY ANALYZER  Eclipse Memory Analyzer (MAT) is…  Java heap analyzer Memory Analyzer  Helps find memory leaks and reduce memory consumption  Query heap dumps via OQL  Multi-Gigabyte Java Heap Dumps Are Nothing to Fear Now  Soooo much faster than other tools, e.g. jhat  Very little memory “overhead” for processing heap dumps (again – cf. jhat)  Provides a report with automatically extracted leak suspects  Supports Sun, SAP, HP, IBM JDKs 1.4.2 and above  Could also process thread dumps and correlate data to provide additional details  Highly extensible  Open source © SAP 2010 / Page 7
  • 8. THE PILL  JRuby extension plugin for Eclipse Memory Analyzer  Plugs into the heap dump processing by means of extension points <extension point="org.eclipse.mat.api.requestResolver"> <resolver impl="org.eclipse.mat.extension.jruby.RubyStacktraceDumper"> </resolver> <resolver impl="org.eclipse.mat.extension.jruby.JRubyScriptResolver"> </resolver> </extension>  Looks for specific JRuby implementation objects in the heap @Subject("org.jruby.internal.runtime.RubyRunnable") @Subject("org.jruby.runtime.ThreadContext")  Produces readable Ruby stack traces  Memory Analyzer 1.1 snapshot/preview download © SAP 2010 / Page 8
  • 9. FURTHER ENHANCEMENTS  Producing hybrid Ruby/Java stack traces  Thread dumps analysis  Specific use case information, e.g. session data  Automation  …  Feedback…  Ideas…  Contributions… … always welcome!  https://dev.eclipse.org/mailman/listinfo/mat-dev http://www.eclipse.org/projects/project_summary.php?projectid=tools.mat © SAP 2010 / Page 9
  • 10. © SAP 2010 / Page 10
  • 11. THANK YOU! Memory Analyzer in: vpavlov t: @giormov