The process is larger than the heap
Heap is the object area managed by the JVM, but the process also uses memory for stacks, classes, buffers, and native components. Setting maximum heap does not cap all process consumption at that value. Account for host or container limits and non-heap memory when planning capacity. Do not copy arguments from a different JVM without confirming support and version.
Usage and collection patterns
A usage curve that rises and falls can be normal allocation and collection. Suspect retention when post-collection occupancy grows persistently under comparable load. Correlate pause duration and frequency with latency and throughput. A larger heap can alter collection frequency and duration but does not automatically fix unintended object retention.
Collect the right artifact
A thread dump shows states and stacks at one moment; multiple samples help reveal progress or persistent waiting. A heap dump serves a different investigation and may be large, sensitive, and disruptive. Decide the tool, format, space, authorization, and secure destination in advance. Diagnostic names and options vary by JVM and version. Use supported procedures for the installed platform.
Workplace application
Before collecting diagnostics, identify JVM, version, and process or container limit. This path’s HotSpot references illustrate diagnostic mechanisms rather than universal WebSphere commands. If post-GC heap is stable but total memory grows, observe threads, buffers, and native memory. Define what collection should confirm, acceptable impact, and where to retain potentially sensitive data.
After each collection, heap returns to roughly the same level, but pauses are long during a peak. This justifies investigating GC behavior and load; it does not prove a memory leak. If post-collection occupancy rises daily under comparable load, the retention hypothesis gains support.
Common pitfalls
Confusing heap and process; using another JVM’s tools without confirming compatibility.
Related topics: Connect threads, pools, and dependencies · Operate TLS, certificates, and configuration
Distinguish heap, total memory, pauses, and retention; select diagnostics based on the hypothesis.
Reference: Java diagnostic tools · DR Middleware 2026.4; HotSpot JDK 25; JDBC 25; PostgreSQL 18; RabbitMQ 4.3; OpenSSL 3.5; explicitly scoped runtime references