liveBook · Manning

Crash

As explained in Troubleshooting Java, Second Edition

An app crash is an application failure in which the application terminates or remains running but stops responding to requests.

A crash is an application failure: the app either stops completely or remains running but no longer responds to requests. Crashes often occur only under specific conditions, making reproduction difficult. section 1.2.4

Use the symptom to choose an investigation path:

  • For a complete stop, look for unrecoverable errors such as OutOfMemoryError and inspect a heap dump. section 1.2.4
  • For an unresponsive app, distinguish a crash from a performance problem; profiling, logging, or a thread dump may be more suitable than a debugger. section 2.3
  • Try to reproduce the failure in an environment where you can observe it and confirm a solution. section 1.2.4

Intentional memory crash

A Java program repeatedly adds Product objects containing random String values to a static list. The list keeps growing until heap memory fills and an OutOfMemoryError occurs.

How Troubleshooting Java, Second Edition covers it

How deep it goes
Defines two crash behaviors and connects memory failures to heap dumps, while deferring detailed heap-dump use.
Examples
Uses a Java loop that retains Product and String instances until an OutOfMemoryError fills the heap.
What it assumes
Assumes familiarity with Java applications and basic debugger use, while defining crash symptoms and reproduction from the beginning.
What you can do after
Diagnose memory-related crashes with reproduction attempts, OutOfMemoryError detection, and heap-dump inspection.
How it connects
Connects crashes with OutOfMemoryError, heap dumps, debuggers, profiling, logging, and thread dumps.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java, Second Edition. The section links point to the parts of the book it draws on.