EIEIOTECHNOVATION
← Training programmes

EIEIO / PROGRAMMING & DEVELOPMENT

Java Performance Tuning and Optimization

Course outline

3 days

Duration

3 days

Outline

  • 1. Getting Started with Performance Tuning
  • Understanding the art of performance tuning
  • Understanding performance issues
  • Classifying performance issues by the discovery phase
  • Requirement phase and design-time issues
  • Development-time issues
  • Testing-time issues
  • Production-time issues
  • Classifying performance issues by the root phase
  • Requirement phase issues
  • Design/architecture phase issues
  • Development phase issues
  • Testing phase issues
  • Operational and environmental-specific issues
  • Performance-handling tactics
  • Proactive measures (preventive)
  • Reactive measures (curative)
  • Understanding the different layers of an enterprise application
  • The three pillars required for performance tuning
  • Define the performance process
  • Getting ready with the required performance tools
  • Being ready to deal with performance issues at any time
  • The cycle of learning
  • Tuning yourself before tuning the application
  • Be a true leader
  • Use your power
  • Be responsible
  • Trust your team
  • Keep it simple
  • Respect roles and responsibilities
  • Understand the application domain and context
  • Protect your reputation
  • Standalone applications versus web applications
  • The standalone application
  • Thick client application – client-server model
  • Thin client application – web-based model
  • Dealing with web applications' performance tuning
  • The two dimensions of web applications' performance tuning
  • Horizontal dimension (node-to-node)
  • Vertical dimension (intranode)
  • Exploring vertical dimension nodes in horizontal dimension nodes
  • Client side
  • Network components
  • HTTP servers (web servers)
  • Application servers
  • Database servers
  • Middleware integration servers
  • Operating system and hardware
  • CPU utilization
  • Network traffic
  • Memory usage
  • Storage I/O performance
  • Summary
  • 2. Understanding Java Fundamentals
  • Discussing the new Java EE 7 features
  • Bean Validation 1.1 (JSR 349)
  • Java API for JSON processing – JSON-P 1.0 (JSR 353)
  • Java API for RESTful web services – JAX-RS 2.0 (JSR 339)
  • Java Servlet 3.1 (JSR 340)
  • Context and Dependency Injection – CDI 1.1 (JSR 346)
  • Interceptors 1.2 (JSR 318)
  • Enterprise JavaBeans – EJB 3.2 (JSR 345)
  • Java Message Service – JMS 2.0 (JSR 343)
  • Concurrency Utilities 1.0 (JSR 236)
  • Batch Applications 1.0 (JSR 352)
  • Java Persistence APIs – JPA 2.1 (JSR 338)
  • JavaServer Faces – JSF 2.2 (JSR 344)
  • Expression language 3.0 (JSR 341)
  • Java Transaction APIs – JTA 1.2 (JSR 907)
  • Java API for WebSocket 1.0 (JSR 356)
  • Understanding memory structure in the JVM
  • The JVM specifications
  • Heap area
  • Method area and runtime constant pool
  • JVM stack
  • Native method stacks (C stacks)
  • PC registers
  • Memory structure in the Java HotSpot virtual machine
  • Generational memory structure
  • The Java HotSpot virtual machine generations
  • Understanding the Java garbage collection policies
  • Different GC options
  • Concurrent versus stop-the-world
  • Serial versus parallel collector
  • Compacting versus non-compacting
  • Summary phase
  • Compacting phase
  • The Garbage-first collector – G1
  • Different application scopes
  • Understanding concurrency in Java
  • Process versus thread
  • Exploring an object monitor
  • Using the Java concurrency utilities
  • Creating a thread pool
  • Using explicit locking with the Lock interface
  • Concurrent resources and utilities
  • The ManagedExecutorService class
  • The ManagedScheduledExecutorService class
  • The ManagedThreadFactory class
  • The important Java EE concurrency features
  • The SingleThreadModel interface
  • Asynchronous servlet and filter
  • The new Java EE non-blocking I/O APIs
  • Session beans asynchronous method invocation
  • A singleton session bean
  • Sending asynchronous JMS messages
  • More information about Java EE 7
  • Summary
  • 3. Getting Familiar with Performance Testing
  • Dissecting performance testing
  • Exploring performance testing aspects
  • Selecting the performance test environment
  • Project milestones and performance
  • Defining different rules and responsibilities
  • Performance testing types
  • Load testing
  • Stress testing
  • Capacity testing
  • Performance testing components
  • Test data
  • Test users
  • Test scenarios
  • Preparing the test environment prior to test execution
  • Test automation
  • Test quality assurance
  • Performance testing tools
  • Performance benchmarking and baseline
  • Isolation testing
  • Performance fixing cycle
  • When to stop tuning?
  • Performance testing terminologies
  • Performance testing in a cloud environment
  • Starting with Apache JMeter
  • Different components of the JMeter test plan
  • The execution order of components
  • Testing with JMeter
  • Using JMeter to test web services
  • Creating a thread group
  • Creating the SOAP sampler
  • Creating listeners
  • Adding an assertion on response
  • Adding the CSV dataset configuration
  • Getting the final results
  • Using JMeter to test a web application
  • Recording our testing scenarios
  • Creating thread groups
  • Creating a configuration element
  • Creating a recording controller
  • Creating a workbench server (HTTP(s) Test Script Recorder)
  • Updating browser settings
  • Start recording our journeys/scenarios
  • Adding cookie control
  • Adding a CSV dataset
  • Adding variables to our requests
  • Adding suitable thinking time
  • Adding response assertions
  • Adding results view
  • Executing our test plan and getting the results
  • Using JMeter to test database scripts
  • Configuring the JDBC connection
  • Adding a JDBC request sampler
  • Adding a CSV dataset configuration
  • Adding listeners to capture test results
  • Summary
  • 4. Monitoring Java Applications
  • Exploring the Java monitoring tools
  • The operating system monitoring tools
  • The Microsoft Windows tools
  • The Unix/Linux tools
  • An example of high CPU utilization
  • The Java monitoring tools
  • The JDK monitoring tools
  • The monitoring tools for application servers
  • The IDE monitoring tools
  • The standalone monitoring tools
  • The multifunction monitoring tools
  • Understanding the profiling tools
  • Profilers modes
  • JVM TI
  • Profiler agent
  • The command-line options
  • Agent start-up
  • Different profiling patterns
  • What we need to know from this section
  • Understanding the different JDK tools
  • The monitoring tool for Java virtual machine statistics
  • The JVM memory map tool
  • The Java heap analysis tool
  • The Java monitoring and management console tool
  • Java VisualVM
  • Oracle Java Mission Control
  • Starting with the NetBeans profiler
  • The NetBeans profiler calibration
  • Using the NetBeans profiler
  • The Eclipse tools/plugins
  • The JVM monitor
  • The Test and Performance Tools Platform
  • Advanced profiler – JProfiler
  • Using the offline profiling mode
  • Building our script using JProfiler triggers
  • Further reading
  • Summary
  • 5. Recognizing Common Performance Issues
  • Going through a slow response time umbrella
  • Isolating the issue
  • Client side
  • HTTP server side (web servers)
  • Application server issue
  • Database server issue
  • Integrated systems
  • Networking components
  • Code and script analysis
  • Profiling the application
  • Common performance issues
  • Threading performance issues
  • Memory performance issues
  • Algorithmic performance issues
  • Work as designed performance issues
  • Interfacing performance issues
  • Miscellaneous performance issues
  • Fake performance issues
  • Threading performance issues
  • Blocking threads
  • Performance symptoms
  • An example of thread blocking
  • Thread deadlock
  • Memory performance issues
  • Memory leakage
  • Performance symptoms
  • An example of memory leakage
  • Improper data caching
  • Improper caching issue types
  • No caching (disabled caching)
  • Too small caching size
  • Too big caching size
  • Using the wrong caching policy
  • Performance symptoms
  • An example of improper caching techniques
  • Work as designed performance issues
  • Synchronous where asynchronous is required
  • Performance symptoms
  • An example of improper synchronous code
  • Neglecting remoteness
  • Performance symptoms
  • An example of using remote calls as local calls
  • Excessive serialization performance impact
  • Performance symptoms
  • An example of excessive serialization
  • Object size impact
  • Web services granularity impact
  • Selected performance issues
  • Unnecessary application logic
  • Excessive application logging
  • Database performance issues
  • Missing proactive tuning
  • Client-side performance issues
  • Chrome developer tools
  • Network analysis
  • JavaScript profiling
  • Speed Tracer
  • Internet Explorer developer tools
  • Firefox developer tools
  • Navigating time specifications
  • Summary
  • 6. CPU Time Profiling
  • When to use CPU profiling
  • Different CPU profiling options
  • Using a NetBeans profiler
  • Profiling a Java application
  • Profiling a web application
  • Using Java Mission Control (JMC)
  • Using JProfiler
  • Reading and interpreting CPU profiling results
  • The call tree view
  • The HotSpots view
  • Analyzing the method time versus the method invocation count
  • The hot spot method types
  • Methods with high self-time
  • Methods with high invocation events
  • Methods with high self-time and invocation events
  • Identifying a hot spot type
  • Identifying potential performance issues
  • Algorithmic/logic issues
  • Caching issues
  • Resourcing issues
  • Threading issues
  • Fixing algorithmic/logic performance
  • Simple algorithmic evaluation
  • Evaluating an algorithm's complexity
  • Our first performance fixing strategy
  • Fixing the application logic/algorithm
  • Adding support for caching
  • Optimizing the performance of resources
  • Implementing concurrency or multithreading
  • Using asynchronous methods
  • Summary
  • 7. Thread Profiling
  • Determining when to use thread profiling
  • Exploring the different thread profiling options
  • Thread monitoring using NetBeans
  • Thread monitoring using JProfiler
  • Thread monitoring using Java Mission Control
  • Reading the thread profiling results
  • Dealing with thread dumps
  • Taking a thread dump using the operating system commands
  • Using the keyboard shortcut Ctrl + Pause Break
  • Sending SIGQUIT to the Java process
  • Taking a thread dump using the JDK tools
  • Thread dump using jstack
  • Thread dump using the Java VisualVM
  • Taking thread dumps using an application's server admin console/tools
  • Taking a thread dump using profiler tools
  • Reading and analyzing the thread dumps
  • Understanding the thread dump structure
  • Analyzing the thread dumps
  • Using Thread Dump Analyzer
  • Exploring potential threading issues
  • Threading performance issues
  • Threading deadlock
  • Blocked/starving/stuck threads
  • Low/over threading
  • Threading memory issues
  • Using unmanaged threads
  • Detecting the root cause of a hung application
  • Detecting the hang location using thread dumps
  • Detecting the hang location using profilers
  • Enhancing our fixing strategy
  • Fixing thread deadlocks and thread blocking
  • Summary
  • 8. Memory Profiling
  • When to use memory profiling?
  • Different memory profiling options
  • Memory profiling using NetBeans
  • Memory profiling using JProfiler
  • Analyzing memory profiling results
  • Analyzing memory space graphs
  • Analyzing detailed object statistics
  • Analyzing garbage collection activity logs (HotSpot JVM)
  • Reading garbage collection activity logs (HotSpot VM)
  • Visualizing the garbage collection activity
  • Dealing with memory heap dumps
  • Taking heap dumps on the occurrence of JVM OutOfMemoryError
  • Taking heap dumps using the JDK tools
  • Taking heap dump using jmap
  • Taking heap dumps using Java VisualVM
  • Taking heap dumps using the JRockit command utility
  • Taking heap dumps using the profiler tools
  • Taking heap dumps using the NetBeans profiler
  • Taking heap dumps using Eclipse Memory Analyzer Tool (MAT)
  • Taking heap dumps using JProfiler
  • Analyzing the heap dump
  • Navigating inside a heap dump using visual tools
  • Query heap dumps using OQL
  • Using simple OQL queries
  • Using OQL built-in objects and functions
  • Using a built-in heap object
  • Using built-in functions on individual objects
  • Potential memory performance issues
  • Application memory leakage (session leakage versus global leakage)
  • Improper caching implementation
  • Memory issues of objects that contain the finalize() method
  • Invalid contract for the equals() and hashCode() methods
  • Different reasons for OOME
  • Adding memory performance issues to our fixing strategy
  • Fixing memory leakage issues
  • Summary
  • 9. Tuning an Application's Environment
  • Understanding environment tuning
  • Tuning the JVM
  • Tuning the Java HotSpot virtual machine
  • Understanding the different types of the JVM parameters
  • Selecting the HotSpot JVM type
  • Tuning memory size
  • Tuning garbage collection
  • Using proper garbage collection policy
  • Setting GC performance targets
  • Tuning the JRockit virtual machine
  • Tuning JRockit memory size
  • Tuning JRockit garbage collection
  • Tuning application servers
  • Tuning the Oracle GlassFish application server
  • Deployment tuning options
  • Web container tuning options
  • EJB container tuning options
  • Thread pool tuning options
  • JDBC connection pool tuning options
  • Tuning file cache components
  • Tuning DNS caching
  • Tuning logging information
  • Tuning the Oracle Weblogic application server
  • Tuning the internal applications' deployment
  • Tuning network components
  • Tuning stuck thread configuration
  • Tuning web servers (HTTP servers)
  • Tuning the Apache web server (Apache HTTP server)
  • Tuning the Oracle web server (Oracle HTTP server)
  • Tuning the operating system and hardware
  • Capacity planning and hardware optimization
  • Operating system configurations optimization
  • Summary
  • 10. Designing High-performance Enterprise Applications
  • Potential performance impact of different design decisions
  • Potential performance impact of the application layer's decisions
  • Potential performance impact of a component's selection decisions
  • Potential performance impact of integration decisions
  • Potential performance impact of security decisions
  • Potential performance impact of framework and UI decisions
  • Potential performance impact of application interaction decisions
  • Potential performance impact of regulatory decisions
  • Potential performance impact of some miscellaneous decisions
  • Avoiding performance anti-patterns
  • Performance aspects of Service Oriented Architecture (SOA)
  • Performance aspects of Resource Oriented Architecture (ROA)
  • Dissecting performance aspects of data caching
  • Data caching versus no caching
  • Caching concurrency and performance
  • Different levels of application data caching
  • Caching an invalidation/expiration algorithm
  • Caching data store interaction
  • Caching replacement policies
  • Data caching performance evaluation
  • Performance considerations in cloud deployment
  • Summary
  • 11. Performance Tuning Tips
  • Performance and development processes
  • Agile and performance
  • Performance and test-driven development (TDD)
  • Manual and automated code review
  • Java EE performance tuning tips
  • Web service (WS) performance tuning tips
  • EJB performance tuning tips
  • Servlets and JSP performance tuning tips
  • JSF performance tuning tips
  • JPA performance tuning tips
  • Java performance tuning tips
  • String manipulation performance tuning tips
  • String creation tips
  • String concatenation tips
  • The JVM String tuning parameters
  • Java collections and performance
  • Using synchronized blocks
  • The I/O operations and performance
  • Exception handling and performance
  • Application logging and performance
  • Using the javap tool to understand micro-optimizations
  • Database performance tuning tips
  • Client-side optimization
  • Summary
  • 12. Tuning a Sample Application
  • Reaching our final destination
  • Setting up the ExcellentSurvey application
  • Functional overview of the ExcellentSurvey application
  • ExcellentSurvey performance assessment
  • Performance investigation plan
  • Profiling our ExcellentSurvey application
  • Getting CPU profiling results
  • Getting memory and thread profiling results
  • Getting database CPU profiling results
  • Profiling performance findings
  • Detected HotSpot methods
  • Detected HotSpot database statements
  • Potential wrong logic issues
  • ExcellentSurvey issues and possible resolutions
  • Fixing the EmailSender.sendEmail() HotSpot method
  • Fixing the DAOHelper.createNewSurvey() HotSpot method
  • Fixing the LoginFilter.log() HotSpot method
  • Fixing the HotSpot autogen table update statement
  • Fixing HotSpot statements to insert questions and survey questions
  • Fixing HotSpot queries that get the notification templates/question rating types
  • Fixing the HotSpot query that counts user surveys
  • Performance code review
  • Testing the application after our fixes
  • Result and conclusion
  • Summary

Programme scope, delivery arrangements and suitability are confirmed during enquiry.