liveBook · Manning

Performance issue

As explained in Troubleshooting Java: Read, debug, and optimize JVM applications

A problem in an application’s use of resources or delivery of service, including but not limited to slow responses.

A performance issue is a problem with how an application delivers service or uses resources. Slow responses are common, but excessive battery or network bandwidth use also counts. Investigate the cause before deciding how to solve it. section 1.2.3

Battery drain from zombie threads

An Android app used a Bluetooth library that created many threads without closing them. The unused threads kept running, contributing to rapid battery consumption; such zombie threads can also cause memory issues and be difficult to investigate. section 1.2.3

For slowness, a profiler can show how much time the application spends on each instruction. File, database, and network I/O calls are common places to investigate; knowing which capability is affected can help narrow the search. Identifying the cause and finding a solution are separate challenges. section 1.2.3

Thread synchronization can also slow execution: locks make threads wait, even when they are needed to protect shared resources. Sample execution first to see whether locks may be involved. If they are, lock profiling can show affected threads, lock counts, monitors, and relationships between waiting threads and the threads causing locks. Use those details to judge whether lock time can be reduced. section 9.4

Investigation and monitoring tools can introduce problems of their own. Storing too many or overly large log messages can affect performance, while a remote debugging agent can slow execution. Avoid remote debugging in production, where it can also interfere with functionality. section 5.2.3 section 4.1

How Troubleshooting Java: Read, debug, and optimize JVM applications covers it

How deep it goes
Explains profiler-guided investigation and lock-profiling steps, while noting that identifying a cause can be easier than solving it.
Examples
Uses battery drain from zombie threads, excessive network bandwidth, and overly numerous or large log messages as examples.
What you can do after
Diagnose slowness with a profiler and investigate suspected lock contention through sampling and lock profiling.
How it connects
Connects performance issues to I/O, thread synchronization, logging, profiling, and remote debugging.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java: Read, debug, and optimize JVM applications. The section links point to the parts of the book it draws on.