Olá
J2SE™ & J2EE™ Performance: Learn how to Write High Performance Java™ Applications
Simon Ritter
Agenda
● J2SE Performance
– Memory allocation and garbage collection
– Profiling
● J2EE performance
– Tuning guidelines
● Further Information
2a parte: J2EE Performance: Tuning Guidelines
When faced with bad performance…
● Ask yourself these questions
● Is it an external issue?
– Database systems, messaging systems, etc.
● Is it an operating environment issue?
– Memory, disk, CPU, network
● Is it an application issue?
– Resulting from bad design or bad coding
– Over-design is a bad design
Servlets and JavaServer Pages
● Avoid shared modified class variables in servlets
– Removes synchronized blocks of code
● Session creation is expensive
– Invalidate sessions no longer needed
– Use <%page session=false%> directive
● prevents automatic session creation in JSP
– Do not store large object graphs in HttpSession
● avoid forced Java serialization
– Do not use HttpSession as cache for transactional data
● Use “read-only” entity beans if available
E por aí foi examinando EJBs, JDBC, Transações com EJBs, HTTP server e finalmente dicas que ele juntou sob o título de miscelânea.
Terminou assim:
Summary: J2SE Performance
● Understanding the virtual machine will help you tune performance
● Use profiling tools to find bottlenecks
● Adapt HotSpot parameters to your application
● Always use the latest JRE
● Sun is always improving Java performance
Summary: J2EE Performance
● J2EE application performance is dependent upon many layers
● Use monitoring tools at all levels
– Application
– Application server
– JVM
– System layer
● Good performance is also equally dependent on good coding
Further Information: J2SE
● java.sun.com/blueprints/performance
● java.sun.com/products/hotspot
● profiler.netbeans.org/index.html
● developers.sun.com/dev/coolstuff/jvmstat
● developer.java.sun.com/developer/technicalArticles/Programming/GCPortal
Further Information: J2EE
● java.sun.com/performance
● javaperformancetuning.com
● Mastering Enterprise Java Beans, Ed Roman
– Design best practices
(download free no TheServerSide)
[]s
Luca