SlideShare a Scribd company logo
1 of 27
Download to read offline
Building the quot;Big Brotherquot;
for the Java Virtual Machine
  Paul René Jørgensen & Steinar Cook
Paul René Jørgensen

Paul René started his coding career on the C64, but was really hooked
when participating in the demo scene on the Amiga writing graphical
presentations in assembly code.

He has worked as a senior consultant at Telenor in Norway for the
past 8 year and been part of establishing the Metro middleware.

He loves to code, and do whatever it takes to get the opportunity to
write code, whether it is at his desk, on the bus or in bed.

Usemon has been developed on and off for the past 3 years, but got
extra momentum when Steinar joined the project in Q3, 2007.
Steinar Overbeck Cook
Steinar wrote his first program back in 1979 in APL and have
been trying to convince his family that programming is work and
not fun ever since.

Special interest in software engineering methods, design
patterns and SQL databases.

After establishing the DBMS vendor Informix in Norway in the
late 90's, which was later sold to IBM, he founded his second
company focusing on CRM software.

He is currently involved with his 3rd startup, www.
SendRegning.no, focusing on a new SaaS solution for the
Scandinavian SMB market
Challenges

 What goes on in the JVM?
 Who invokes who?
 Runtime dependencies (late binding)
 Who uses the CPU?
 Irregular use of exceptions
 Are the servers balanced in your clusters
 Main call paths through the entire system
 Invocation count and response times
 Only interested in our selected classes and methods
Possible Solutions

  Many tools
    Costly
    Proprietary
        No extension points
        Limited to the built in reports
    Complicated
    Intrusive?
        Some may require code modifications
Possible Solutions (cont.)
I'm a programmer and I want to do this myself!
Overall Architecture
The agent

 Bootstrapping the JVM
    JDK >= 5.0
        Hook into the Java Agent Interface
    JDK <= 1.4
        Modify system supplied java.lang.ClassLoader
        Modify the JVM startup
 Modification of byte code during class loading
 Bootstrapping the internal registry and the publisher
 Measure and assemble observations
 Multi casting observations to the collector
Boostrapping JVM >= 5.0

  Starting the JVM with modified class loader
 java
    -javaagent:usemon-agent.jar
Java Agent Interface for JVM <= 1.4
Emulating Java Agent Interface
JVM <= 1.4 - modifying the class loader
Boostrapping JVM <= 1.4

  Starting the JVM with modified class loader

 java
   -Xbootclasspath/p:usemon-bootstrap.jar
   -cp usemon-agent.jar

  Run through the java.lang.ClassLoader code and
  intercept all calls to defineClass0
  Insert code that let the Usemon RootInstrumentor
  class modify the byte code before the original
  defineClass0 is invoked
Byte code modification during class loading

  Identify interesting classes
     Enterprise Java Beans
          SessionBeans
          EntityBeans
     Message Driven Beans
     Servlets
     QueueSenders
     TopicPublishers
     SqlStatements
     SqlConnections
     Custom classes based on user defined patterns
Measure and assemble observations
Internal registry and the publisher
  Aggregates observations for an interval of 60 seconds:
  Yields if the JVM is approaching critical state
     JVM Garbage Collector removes quot;Soft referencesquot;
     quot;Soft referencesquot; versus quot;Weak referencesquot;
Multi casting observations

Goals:
   Must not interfere with business code
   Fault tolerance
   Loose couplings
Assumption:
   Loosing some observations is acceptable
Conclusion; We needed a message queue!
   UDP multicast - simplest form of asynchronous messaging
   Proven in battle by Telenor:
       Metro logging framework transports several GB per day
The collector

  Stand alone Java process
  Receive multi casted observations
     Hop count
     Format: Java or JSON
  Cache observations to increase database insert
  performance
  Reorganize and store
  Drop observations if heap space falls below threshold
     Receive rate higher than storage rate
  Monitoring and management through JMX
The repository of collected data

  SQL quot;star schemaquot; with 3 facts:
     Method invocations
     Method dependencies
     Heap usage
  Available dimensions:
     Location (platform, cluster, server)
     Package
     Class
     Method (with signature)
     Principal
     Date and time
Method measurement fact
Method dependency fact
OLAP / BI

 Several OLAP/BI tools available
    Mostly commercial and expensive
    A few OSS tools based upon mondrian
 Requires detailed knowledge of the OLAP cube model and
 MDX query language
    Cube model based upon Usemon dimensional model
        Simplifies the writing of queries
        Slice & dice is much simpler with MDX than SQL
 Jasper Server & Jasper Analysis
Invocations split over servers for 24h
Exceptional exits
Current usage in Metro

Usemon is now being used in an ongoing project to discover potential
improvements in over 80 enterprise applications on Metro.

We try to find the worst pieces of code
   Bad response time and a lot of usage
   Big percentage exception exits
We'll suggest changes and improvements with great accuracy
based on the data that Usemon provide.
Usemon|Live

 A proof of concept real time UI
 Based on the Processing data visualization framework
    http://processing.org
 Made for big screen presentation
 Animates class dependencies as graphs
    Green arrows is invocations
    Spring layout
Where can I find it?

   Project site is hosted on Google Code under MPL license
               http://usemon.org

                     Presentation slides

  http://www.slideshare.net/paulrene

More Related Content

What's hot

What is Loadrunner ?
What is Loadrunner ?What is Loadrunner ?
What is Loadrunner ?Guru99
 
Why JVM will outlive java?
Why JVM will outlive java?Why JVM will outlive java?
Why JVM will outlive java?Ram Lakshmanan
 
Introduction To Perl - SpringPeople
Introduction To Perl - SpringPeopleIntroduction To Perl - SpringPeople
Introduction To Perl - SpringPeopleSpringPeople
 
Web Application Optimization Techniques
Web Application Optimization TechniquesWeb Application Optimization Techniques
Web Application Optimization Techniquestakinbo
 
Designing the Call of Cthulhu app with Google App Engine
Designing the Call of Cthulhu app with Google App EngineDesigning the Call of Cthulhu app with Google App Engine
Designing the Call of Cthulhu app with Google App EngineChris Bunch
 
AppScale Talk at SBonRails
AppScale Talk at SBonRailsAppScale Talk at SBonRails
AppScale Talk at SBonRailsChris Bunch
 
Apache Harmony: An Open Innovation
Apache Harmony: An Open InnovationApache Harmony: An Open Innovation
Apache Harmony: An Open InnovationTim Ellison
 
Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7StephenKardian
 

What's hot (8)

What is Loadrunner ?
What is Loadrunner ?What is Loadrunner ?
What is Loadrunner ?
 
Why JVM will outlive java?
Why JVM will outlive java?Why JVM will outlive java?
Why JVM will outlive java?
 
Introduction To Perl - SpringPeople
Introduction To Perl - SpringPeopleIntroduction To Perl - SpringPeople
Introduction To Perl - SpringPeople
 
Web Application Optimization Techniques
Web Application Optimization TechniquesWeb Application Optimization Techniques
Web Application Optimization Techniques
 
Designing the Call of Cthulhu app with Google App Engine
Designing the Call of Cthulhu app with Google App EngineDesigning the Call of Cthulhu app with Google App Engine
Designing the Call of Cthulhu app with Google App Engine
 
AppScale Talk at SBonRails
AppScale Talk at SBonRailsAppScale Talk at SBonRails
AppScale Talk at SBonRails
 
Apache Harmony: An Open Innovation
Apache Harmony: An Open InnovationApache Harmony: An Open Innovation
Apache Harmony: An Open Innovation
 
Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7
 

Similar to Usemon; Building The Big Brother Of The Java Virtual Machinve

Java performance tuning
Java performance tuningJava performance tuning
Java performance tuningJerry Kurian
 
Flex 4.5 jeyasekar
Flex 4.5  jeyasekarFlex 4.5  jeyasekar
Flex 4.5 jeyasekarjeya soft
 
Pragmatic Architecture in .NET
Pragmatic Architecture in .NETPragmatic Architecture in .NET
Pragmatic Architecture in .NEThousecor
 
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...Craeg Strong
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel Partners20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel PartnersCraeg Strong
 
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACHPERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACHcscpconf
 
Performance comparison on java technologies a practical approach
Performance comparison on java technologies   a practical approachPerformance comparison on java technologies   a practical approach
Performance comparison on java technologies a practical approachcsandit
 
RAHUL_Updated( (2)
RAHUL_Updated( (2)RAHUL_Updated( (2)
RAHUL_Updated( (2)Rahul Singh
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsSalesforce Developers
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel Partners20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel PartnersCraeg Strong
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch ProcessingChris Adkin
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2divzi1913
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassPaul Withers
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless ComputingAnand Gupta
 

Similar to Usemon; Building The Big Brother Of The Java Virtual Machinve (20)

Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Flex 4.5 jeyasekar
Flex 4.5  jeyasekarFlex 4.5  jeyasekar
Flex 4.5 jeyasekar
 
Pragmatic Architecture in .NET
Pragmatic Architecture in .NETPragmatic Architecture in .NET
Pragmatic Architecture in .NET
 
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel Partners20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211202 NADOG Adapting to Covid with Serverless Craeg Strong Ariel Partners
 
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACHPERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
 
Performance comparison on java technologies a practical approach
Performance comparison on java technologies   a practical approachPerformance comparison on java technologies   a practical approach
Performance comparison on java technologies a practical approach
 
RAHUL_Updated( (2)
RAHUL_Updated( (2)RAHUL_Updated( (2)
RAHUL_Updated( (2)
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce Applications
 
SunMicroSystems
SunMicroSystemsSunMicroSystems
SunMicroSystems
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel Partners20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel Partners
20211028 ADDO Adapting to Covid with Serverless Craeg Strong Ariel Partners
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
 
.net Framework
.net Framework.net Framework
.net Framework
 
Sunstate
SunstateSunstate
Sunstate
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClass
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless Computing
 
Sunstate
SunstateSunstate
Sunstate
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Usemon; Building The Big Brother Of The Java Virtual Machinve

  • 1. Building the quot;Big Brotherquot; for the Java Virtual Machine Paul René Jørgensen & Steinar Cook
  • 2. Paul René Jørgensen Paul René started his coding career on the C64, but was really hooked when participating in the demo scene on the Amiga writing graphical presentations in assembly code. He has worked as a senior consultant at Telenor in Norway for the past 8 year and been part of establishing the Metro middleware. He loves to code, and do whatever it takes to get the opportunity to write code, whether it is at his desk, on the bus or in bed. Usemon has been developed on and off for the past 3 years, but got extra momentum when Steinar joined the project in Q3, 2007.
  • 3. Steinar Overbeck Cook Steinar wrote his first program back in 1979 in APL and have been trying to convince his family that programming is work and not fun ever since. Special interest in software engineering methods, design patterns and SQL databases. After establishing the DBMS vendor Informix in Norway in the late 90's, which was later sold to IBM, he founded his second company focusing on CRM software. He is currently involved with his 3rd startup, www. SendRegning.no, focusing on a new SaaS solution for the Scandinavian SMB market
  • 4. Challenges What goes on in the JVM? Who invokes who? Runtime dependencies (late binding) Who uses the CPU? Irregular use of exceptions Are the servers balanced in your clusters Main call paths through the entire system Invocation count and response times Only interested in our selected classes and methods
  • 5. Possible Solutions Many tools Costly Proprietary No extension points Limited to the built in reports Complicated Intrusive? Some may require code modifications
  • 6. Possible Solutions (cont.) I'm a programmer and I want to do this myself!
  • 8. The agent Bootstrapping the JVM JDK >= 5.0 Hook into the Java Agent Interface JDK <= 1.4 Modify system supplied java.lang.ClassLoader Modify the JVM startup Modification of byte code during class loading Bootstrapping the internal registry and the publisher Measure and assemble observations Multi casting observations to the collector
  • 9. Boostrapping JVM >= 5.0 Starting the JVM with modified class loader java -javaagent:usemon-agent.jar
  • 10. Java Agent Interface for JVM <= 1.4
  • 12. JVM <= 1.4 - modifying the class loader
  • 13. Boostrapping JVM <= 1.4 Starting the JVM with modified class loader java -Xbootclasspath/p:usemon-bootstrap.jar -cp usemon-agent.jar Run through the java.lang.ClassLoader code and intercept all calls to defineClass0 Insert code that let the Usemon RootInstrumentor class modify the byte code before the original defineClass0 is invoked
  • 14. Byte code modification during class loading Identify interesting classes Enterprise Java Beans SessionBeans EntityBeans Message Driven Beans Servlets QueueSenders TopicPublishers SqlStatements SqlConnections Custom classes based on user defined patterns
  • 15. Measure and assemble observations
  • 16. Internal registry and the publisher Aggregates observations for an interval of 60 seconds: Yields if the JVM is approaching critical state JVM Garbage Collector removes quot;Soft referencesquot; quot;Soft referencesquot; versus quot;Weak referencesquot;
  • 17. Multi casting observations Goals: Must not interfere with business code Fault tolerance Loose couplings Assumption: Loosing some observations is acceptable Conclusion; We needed a message queue! UDP multicast - simplest form of asynchronous messaging Proven in battle by Telenor: Metro logging framework transports several GB per day
  • 18. The collector Stand alone Java process Receive multi casted observations Hop count Format: Java or JSON Cache observations to increase database insert performance Reorganize and store Drop observations if heap space falls below threshold Receive rate higher than storage rate Monitoring and management through JMX
  • 19. The repository of collected data SQL quot;star schemaquot; with 3 facts: Method invocations Method dependencies Heap usage Available dimensions: Location (platform, cluster, server) Package Class Method (with signature) Principal Date and time
  • 22. OLAP / BI Several OLAP/BI tools available Mostly commercial and expensive A few OSS tools based upon mondrian Requires detailed knowledge of the OLAP cube model and MDX query language Cube model based upon Usemon dimensional model Simplifies the writing of queries Slice & dice is much simpler with MDX than SQL Jasper Server & Jasper Analysis
  • 23. Invocations split over servers for 24h
  • 25. Current usage in Metro Usemon is now being used in an ongoing project to discover potential improvements in over 80 enterprise applications on Metro. We try to find the worst pieces of code Bad response time and a lot of usage Big percentage exception exits We'll suggest changes and improvements with great accuracy based on the data that Usemon provide.
  • 26. Usemon|Live A proof of concept real time UI Based on the Processing data visualization framework http://processing.org Made for big screen presentation Animates class dependencies as graphs Green arrows is invocations Spring layout
  • 27. Where can I find it? Project site is hosted on Google Code under MPL license http://usemon.org Presentation slides http://www.slideshare.net/paulrene