SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
© 2014 IBM Corporation 
SHOW104: Practical Java 
Mark Myers, London Developer Coop 
Julian Robichaux, panagenda
154 
Performance Analysis and Troubleshooting
Code Optimization 
 
Make your code work first, then worry about speed 
– 
You always want working code to fall back on 
 
Is it fast enough? Leave it alone. 
 
An elegant solution that is slightly slower is often better than an ugly solution that is slightly faster 
 
Making code shorter doesn’t make it faster 
 
Keep the code readable and easy to troubleshoot 
 
Don’t assume you know where the bottleneck is 
“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil” - Donald Knuth
Static Code Analyzers 
 
FindBugs is a great tool for finding potential problems 
 
Bugs grouped by categories 
– 
Scariest 
– 
Scary 
– 
Troubling 
 
Also subcategories like “Correctness”, “Security”, “Performance”, and “Dodgy Code” 
 
New cloud option for development teams 
– 
Rank bugs, assign fixes 
 
http://findbugs.sourceforge.net 
 
http://www.cs.umd.edu/~pugh/MistakesThatMatter.pdf
FindBugs
FindBugs
Debugging, Logging, and Unit Testing 
 
Mark and Julian did a 2-hour presentation on debugging, logging, and unit testing at Lotusphere 2012 
– 
Please see the slides at: 
– 
http://londondevelopercoop.com/ldc.nsf/pages/goodies 
 
Highlights: 
– 
How to add unit testing to Java code in DDE 
– 
How to add unit testing to JavaScript code 
– 
Debugging Java agents on Notes clients and Domino servers 
– 
Debugging Java classes used by XPages 
– 
Tips for using Java logging
Common Bottlenecks 
 
Some other guy’s server 
 
Slow database queries 
 
Memory issues 
– 
Leaks (less common than you’d think) 
– 
Too much cached information 
• 
Especially large objects, strings, XML 
– 
Strong references 
 
Loading and unloading resources 
 
Non-lazy initialization of objects 
 
Slow or broken network connection
Simulating Poor Network Connections 
 
http://www.charlesproxy.com 
 
http://jagt.github.io/clumsy 
 
Network Link Conditioner (OSX) 
– 
XCode > Open Developer Tool > More Developer Tools
Analyzing Java Memory Usage 
 
Used for: 
– 
Tracking down memory leaks 
– 
Finding high-memory-use objects (and arrays) 
– 
Finding objects that are unexpectedly still in memory 
 
IBM Heap Analyzer 
– 
https://www.ibm.com/developerworks/community/alphaworks/tech/heapanalyzer 
– 
http://www-01.ibm.com/support/docview.wss?uid=swg27006624&aid=1 
 
YourKit Java profiling app 
– 
http://yourkit.com 
– 
http://notesin9.com/index.php/2012/11/29/notesin9-091-xpages-memory-profiling-part-1 
 
Eclipse Memory Analysis Tool 
– 
http://www.eclipse.org/mat/downloads.php 
– 
http://lazynotesguy.net/blog/2013/08/30/wheres-my-memory-gone-peeking-inside-jvms- heap-part-1-installation 
– 
http://lazynotesguy.net/blog/2013/10/04/peeking-inside-jvms-heap-part-2-usage
Generating Heap Dumps with Notes/Domino 
 
Domino XPages 
– 
tell http xsp heapdump 
– 
XPages Toolbox ( http://www.openntf.org/p/XPages%20Toolbox ) 
 
Notes Client (Expeditor) 
– 
notesframeworkrcprcplauncher.exe -com.ibm.rcp.core.logger#dump heap -dumps heapdump 
– 
writes to notesdataworkspacelogsheapdump.###.phd by default 
– 
You can also do a core (thread) dump with: 
• 
notesframeworkrcprcplauncher.exe -com.ibm.rcp.core.logger#dump threads -dumps javacore 
 
Directly from Java 
– 
com.ibm.jvm.Dump.HeapDump(); 
– 
writes to notesframeworkheapdump.###.phd when run from an agent
 
Access Connect Online to complete your session surveys using any: 
– 
Web or mobile browser 
– 
Connect Online kiosk onsite 
167 
Mark Myers London Developer Coop mark@energywins.co.uk Twitter: @stickfight 
Julian Robichaux panagenda jrobichaux@panagenda.com Twitter: @jrobichaux
168 
Acknowledgements and Disclaimers 
© Copyright IBM Corporation 2014. All rights reserved. 
 
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
 
IBM, the IBM logo, ibm.com, IBM WebSphere, IBM Notes, IBM Connections, Rational, and DB2 are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml 
 
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. 
 
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. 
 
Other company, product, or service names may be trademarks or service marks of others. 
Availability. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. 
The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS-IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. 
All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.

Weitere ähnliche Inhalte

Mehr von SocialBiz UserGroup

Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...SocialBiz UserGroup
 
Tip from ConnectED 2015: Best and Worst Practices Deploying IBM Connections
Tip from ConnectED 2015: Best and Worst Practices Deploying IBM ConnectionsTip from ConnectED 2015: Best and Worst Practices Deploying IBM Connections
Tip from ConnectED 2015: Best and Worst Practices Deploying IBM ConnectionsSocialBiz UserGroup
 
Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...
Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...
Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...SocialBiz UserGroup
 
Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...
Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...
Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...SocialBiz UserGroup
 
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...SocialBiz UserGroup
 
Tip from ConnectED 2015: Mobile security roundup
Tip from ConnectED 2015: Mobile security roundupTip from ConnectED 2015: Mobile security roundup
Tip from ConnectED 2015: Mobile security roundupSocialBiz UserGroup
 
Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...
Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...
Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...SocialBiz UserGroup
 
Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...
Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...
Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...SocialBiz UserGroup
 
Tip from ConnectED 2015: Considerations for the cloud
Tip from ConnectED 2015: Considerations for the cloudTip from ConnectED 2015: Considerations for the cloud
Tip from ConnectED 2015: Considerations for the cloudSocialBiz UserGroup
 
Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...
Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...
Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...SocialBiz UserGroup
 
Tip from IBM Connect2014: XPages Accessibility
Tip from IBM Connect2014: XPages AccessibilityTip from IBM Connect2014: XPages Accessibility
Tip from IBM Connect2014: XPages AccessibilitySocialBiz UserGroup
 
Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...
Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...
Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...SocialBiz UserGroup
 
Tip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.x
Tip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.xTip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.x
Tip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.xSocialBiz UserGroup
 
Tip from IBM Connect 2014: Mobile security roundup
Tip from IBM Connect 2014: Mobile security roundupTip from IBM Connect 2014: Mobile security roundup
Tip from IBM Connect 2014: Mobile security roundupSocialBiz UserGroup
 
Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...
Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...
Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...SocialBiz UserGroup
 
Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...
Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...
Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...SocialBiz UserGroup
 
Tip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your Options
Tip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your OptionsTip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your Options
Tip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your OptionsSocialBiz UserGroup
 
Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...
Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...
Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...SocialBiz UserGroup
 
Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...
Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...
Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...SocialBiz UserGroup
 
Tip from IBM Connect 2014: IBM Domino 64-bit: All you need to know
Tip from IBM Connect 2014: IBM Domino 64-bit: All you need to knowTip from IBM Connect 2014: IBM Domino 64-bit: All you need to know
Tip from IBM Connect 2014: IBM Domino 64-bit: All you need to knowSocialBiz UserGroup
 

Mehr von SocialBiz UserGroup (20)

Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
Tip from ConnectED 2015: IBM Sametime - Design and Implementation of a Full H...
 
Tip from ConnectED 2015: Best and Worst Practices Deploying IBM Connections
Tip from ConnectED 2015: Best and Worst Practices Deploying IBM ConnectionsTip from ConnectED 2015: Best and Worst Practices Deploying IBM Connections
Tip from ConnectED 2015: Best and Worst Practices Deploying IBM Connections
 
Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...
Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...
Tip from ConnectED 2015: Using Bootstrap and Ratchet frameworks in Domino mob...
 
Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...
Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...
Tip from ConnectED 2015: An intro to IBM Security Directory Integrator for IB...
 
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
Tip from ConnectED 2015: How to Use Those Cool New Frameworks in Mobile Domin...
 
Tip from ConnectED 2015: Mobile security roundup
Tip from ConnectED 2015: Mobile security roundupTip from ConnectED 2015: Mobile security roundup
Tip from ConnectED 2015: Mobile security roundup
 
Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...
Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...
Tip from ConnectED: Notes Goes Cloud: The IBM Notes Browser Plug-in Integrate...
 
Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...
Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...
Tip from ConnectED 2015: Managing your Enterprise Data in the Cloud – Securit...
 
Tip from ConnectED 2015: Considerations for the cloud
Tip from ConnectED 2015: Considerations for the cloudTip from ConnectED 2015: Considerations for the cloud
Tip from ConnectED 2015: Considerations for the cloud
 
Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...
Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...
Tip from IBM Connect 2014: Rapid XPages Developing Using the Application Layo...
 
Tip from IBM Connect2014: XPages Accessibility
Tip from IBM Connect2014: XPages AccessibilityTip from IBM Connect2014: XPages Accessibility
Tip from IBM Connect2014: XPages Accessibility
 
Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...
Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...
Tip from IBM Connect 2014: Extend Your Security into the Cloud with IBM Smart...
 
Tip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.x
Tip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.xTip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.x
Tip from IBM Connect 2014: New security features in IBM Domino 8.5.x-9.x
 
Tip from IBM Connect 2014: Mobile security roundup
Tip from IBM Connect 2014: Mobile security roundupTip from IBM Connect 2014: Mobile security roundup
Tip from IBM Connect 2014: Mobile security roundup
 
Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...
Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...
Tip from IBM Connect 2014: Socialytics = Social Business, Big Social Data and...
 
Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...
Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...
Tip from IBM Connect 2014: IBM Notes Goes Cloud: How GAD Created an Integrate...
 
Tip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your Options
Tip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your OptionsTip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your Options
Tip from IBM Connect 2014: Stepping into the Cloud and Evaluating Your Options
 
Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...
Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...
Tip from IBM Connect 2014: What You Shouldn't Care About With Cloud, But Do A...
 
Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...
Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...
Tip from IBM Connect 2014: XPages Mobile Development in IBM Domino 9.0.1 and ...
 
Tip from IBM Connect 2014: IBM Domino 64-bit: All you need to know
Tip from IBM Connect 2014: IBM Domino 64-bit: All you need to knowTip from IBM Connect 2014: IBM Domino 64-bit: All you need to know
Tip from IBM Connect 2014: IBM Domino 64-bit: All you need to know
 

KĂĽrzlich hochgeladen

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
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 educationjfdjdjcjdnsjd
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Christopher Logan Kennedy
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
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 TerraformAndrey Devyatkin
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

KĂĽrzlich hochgeladen (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Tip from Connect 2014: Java performance analysis and troubleshooting

  • 1. © 2014 IBM Corporation SHOW104: Practical Java Mark Myers, London Developer Coop Julian Robichaux, panagenda
  • 2. 154 Performance Analysis and Troubleshooting
  • 3. Code Optimization  Make your code work first, then worry about speed – You always want working code to fall back on  Is it fast enough? Leave it alone.  An elegant solution that is slightly slower is often better than an ugly solution that is slightly faster  Making code shorter doesn’t make it faster  Keep the code readable and easy to troubleshoot  Don’t assume you know where the bottleneck is “We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil” - Donald Knuth
  • 4. Static Code Analyzers  FindBugs is a great tool for finding potential problems  Bugs grouped by categories – Scariest – Scary – Troubling  Also subcategories like “Correctness”, “Security”, “Performance”, and “Dodgy Code”  New cloud option for development teams – Rank bugs, assign fixes  http://findbugs.sourceforge.net  http://www.cs.umd.edu/~pugh/MistakesThatMatter.pdf
  • 7. Debugging, Logging, and Unit Testing  Mark and Julian did a 2-hour presentation on debugging, logging, and unit testing at Lotusphere 2012 – Please see the slides at: – http://londondevelopercoop.com/ldc.nsf/pages/goodies  Highlights: – How to add unit testing to Java code in DDE – How to add unit testing to JavaScript code – Debugging Java agents on Notes clients and Domino servers – Debugging Java classes used by XPages – Tips for using Java logging
  • 8. Common Bottlenecks  Some other guy’s server  Slow database queries  Memory issues – Leaks (less common than you’d think) – Too much cached information • Especially large objects, strings, XML – Strong references  Loading and unloading resources  Non-lazy initialization of objects  Slow or broken network connection
  • 9. Simulating Poor Network Connections  http://www.charlesproxy.com  http://jagt.github.io/clumsy  Network Link Conditioner (OSX) – XCode > Open Developer Tool > More Developer Tools
  • 10. Analyzing Java Memory Usage  Used for: – Tracking down memory leaks – Finding high-memory-use objects (and arrays) – Finding objects that are unexpectedly still in memory  IBM Heap Analyzer – https://www.ibm.com/developerworks/community/alphaworks/tech/heapanalyzer – http://www-01.ibm.com/support/docview.wss?uid=swg27006624&aid=1  YourKit Java profiling app – http://yourkit.com – http://notesin9.com/index.php/2012/11/29/notesin9-091-xpages-memory-profiling-part-1  Eclipse Memory Analysis Tool – http://www.eclipse.org/mat/downloads.php – http://lazynotesguy.net/blog/2013/08/30/wheres-my-memory-gone-peeking-inside-jvms- heap-part-1-installation – http://lazynotesguy.net/blog/2013/10/04/peeking-inside-jvms-heap-part-2-usage
  • 11. Generating Heap Dumps with Notes/Domino  Domino XPages – tell http xsp heapdump – XPages Toolbox ( http://www.openntf.org/p/XPages%20Toolbox )  Notes Client (Expeditor) – notesframeworkrcprcplauncher.exe -com.ibm.rcp.core.logger#dump heap -dumps heapdump – writes to notesdataworkspacelogsheapdump.###.phd by default – You can also do a core (thread) dump with: • notesframeworkrcprcplauncher.exe -com.ibm.rcp.core.logger#dump threads -dumps javacore  Directly from Java – com.ibm.jvm.Dump.HeapDump(); – writes to notesframeworkheapdump.###.phd when run from an agent
  • 12.  Access Connect Online to complete your session surveys using any: – Web or mobile browser – Connect Online kiosk onsite 167 Mark Myers London Developer Coop mark@energywins.co.uk Twitter: @stickfight Julian Robichaux panagenda jrobichaux@panagenda.com Twitter: @jrobichaux
  • 13. 168 Acknowledgements and Disclaimers © Copyright IBM Corporation 2014. All rights reserved.  U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  IBM, the IBM logo, ibm.com, IBM WebSphere, IBM Notes, IBM Connections, Rational, and DB2 are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml  Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.  Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.  Other company, product, or service names may be trademarks or service marks of others. Availability. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS-IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.