Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

JudCon 2010 Berlin: Practical Enterprise Java Performance Tuning


Published on

presentation by

Matt Brasier
Head of Consulting, C2B2 Ltd

  • Be the first to like this

JudCon 2010 Berlin: Practical Enterprise Java Performance Tuning

  1. 1.
  2. 2. Practical Enterprise Java Performance Tuning<br />Matt Brasier<br />Principal Consultant, C2B2 Ltd<br />
  3. 3. Agenda<br />Introduction<br />Performance tuning toolbox<br />Examples<br />Summary<br />
  4. 4. Introduction<br />Who Am I?<br />Matt Brasier<br />Principal Consultant at C2B2 Consulting<br />10 years Java EE experience<br />6 years as a consultant<br />
  5. 5. Introduction<br />This talk<br />Introduction to tools used<br />Practical demonstrations<br />Download the example application<br /><br />
  6. 6. Performance consultant’s toolbox<br />
  7. 7. JBoss admin console<br />
  8. 8. JBoss admin console<br />http://localhost:8080/admin-console<br />Since JBoss 5<br />Cut-down version of RHQ<br />
  9. 9. JBoss jmx-console<br />
  10. 10. JBoss jmx-console<br />http://localhost:8080/jmx-console<br />Dynamic view of JMX mbeans<br />Information overload<br />Fast if you know what you are looking for<br />A few really useful features<br />
  11. 11. VisualVM<br />
  12. 12. VisualVM<br />Distributed with JDK 6<br />Successor to jconsole<br />Install all the plugins!<br />jvisualvm from the command line<br />
  13. 13. Command line JDK tools<br />jps<br />Process IDs of Java processes<br />jstat<br />JVM statistics for things such as GC<br />jstack<br />Thread dumps<br />jhat<br />Heap dump analysis<br />
  14. 14. Testing Tools<br />
  15. 15. JMeter<br />
  16. 16. JMeter<br /><br />Load testing tool<br />Easy to produce scripts<br />Can record scripts from a browser<br />Can run in distributed mode<br />
  17. 17. The Grinder<br />
  18. 18. The Grinder<br /><br />Load testing tool<br />More complex scripts than Jmeter<br />Jython based<br />Better for extreme testing<br />
  19. 19. Live Demo<br />
  20. 20. Summary<br />The JVM and JMX make a lot of information available<br />The tools to get at the information are readily available<br />All that you have to do is understand what it is telling you<br />
  21. 21. Hot method<br />Repeated Thread dumps reveals one method appears frequently<br />It is either occuring a lot or running slowly<br />
  22. 22. System.gc<br />Frequent major garbage collections<br />jstat shows a large GCT and System.gc as the previous GC cause<br />VisualVM shows large proportion of CPU time spent garbage collecting<br />
  23. 23. Synchronization<br />Thread dump reveals large number of threads blocked waiting for the same lock<br />
  24. 24. Key techniques<br />Load testing<br />Thread dumps<br />Visual VM<br />Swiss army knife of Java consultants<br />
  25. 25. Questions?<br />
  26. 26. Thank you<br />