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
PPT
Practical JRuby
PPT
Ruby On Google App Engine 2nd Athens Ruby Me
PDF
Bitter Java, Sweeten with JRuby
PPT
The Evolution of Java
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
Practical JRuby
Ruby On Google App Engine 2nd Athens Ruby Me
Bitter Java, Sweeten with JRuby
The Evolution of Java

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

ODP
3978 Why is Java so different... A Session for Cobol/PLI/Assembler Developers
DOCX
DavidWible_res
ODP
PDF
Node.js an Exectutive View
PDF
node.js 실무 - node js in practice by Jesang Yoon
PPTX
Follow these reasons to know java’s importance
PDF
Why don't you Groovy?
PPT
Java ppt-class_Introduction_class_Objects.ppt
PPT
Java ppt-class_basic data types methods definitions
PDF
GlassFish can support multiple Ruby frameworks ... really ?
PDF
Glass fish rubyconf-india-2010-Arun gupta
PDF
JRuby and Google App Engine
PPTX
SoftwareUniversity seminar fast REST Api with Spring
PPTX
Migrating to Java 11
PPT
Get ready for FRC 2015: Intro to Java 5 through 8 updates and Eclipse
PPTX
Module1_htryjtjhkrhdegtfhsfhrdgfhpart1.pptx
PPTX
1 Introduction to JAVA.pptx
PPTX
Leaner microservices with Java 10
ODP
DiUS Computing Lca Rails Final
3978 Why is Java so different... A Session for Cobol/PLI/Assembler Developers
DavidWible_res
Node.js an Exectutive View
node.js 실무 - node js in practice by Jesang Yoon
Follow these reasons to know java’s importance
Why don't you Groovy?
Java ppt-class_Introduction_class_Objects.ppt
Java ppt-class_basic data types methods definitions
GlassFish can support multiple Ruby frameworks ... really ?
Glass fish rubyconf-india-2010-Arun gupta
JRuby and Google App Engine
SoftwareUniversity seminar fast REST Api with Spring
Migrating to Java 11
Get ready for FRC 2015: Intro to Java 5 through 8 updates and Eclipse
Module1_htryjtjhkrhdegtfhsfhrdgfhpart1.pptx
1 Introduction to JAVA.pptx
Leaner microservices with Java 10
DiUS Computing Lca Rails Final
Ad

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
A Presentation on Artificial Intelligence
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Empathic Computing: Creating Shared Understanding
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Electronic commerce courselecture one. Pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
A Presentation on Artificial Intelligence
Programs and apps: productivity, graphics, security and other tools
“AI and Expert System Decision Support & Business Intelligence Systems”
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
20250228 LYD VKU AI Blended-Learning.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
sap open course for s4hana steps from ECC to s4
Empathic Computing: Creating Shared Understanding
A comparative analysis of optical character recognition models for extracting...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
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