Improve heap dump creation for customer instances
Open
Nobody has claimed this yet.
Priority : 3 Average
stale
Team : Platform
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
Customer instances need better heap dump creation capabilities for troubleshooting OutOfMemoryError issues and on-demand memory analysis.
Requirements
- Automatic heap dump on OOM: Enable -XX:+HeapDumpOnOutOfMemoryError JVM flag
- On-demand heap dump creation: Provide mechanism for customers/support to trigger heap dumps manually
- Standardized storage location: Store heap dumps in /data/shared folder structure for consistent access
Implementation Details
Automatic OOM Heap Dumps
- Configure JVM startup with -XX:+HeapDumpOnOutOfMemoryError
- Set heap dump path to /data/shared/heapdumps/ directory
- Use -XX:HeapDumpPath=/data/shared/heapdumps/
On-Demand Heap Dump Creation
- Create REST endpoint or admin utility for manual heap dump generation
- Use JMX MBeans (HotSpotDiagnosticMXBean.dumpHeap()) for programmatic dumps
- Include timestamp and instance identifier in filename
Directory Structure
/data/shared/
├── heapdumps/
│ ├── oom-dump-[timestamp]-[pid].hprof
│ └── manual-dump-[timestamp]-[instance].hprof
Acceptance Criteria
- JVM automatically creates heap dump on OutOfMemoryError
- Heap dumps are stored in /data/shared/heapdumps/ directory
- On-demand heap dump creation is available via admin interface
- Heap dump files include timestamp and identifying information
- Directory permissions allow customer access to dump files
- Documentation updated with heap dump procedures
Technical Considerations
- Ensure sufficient disk space monitoring for heap dumps
- Consider heap dump file rotation/cleanup policies
- Add proper error handling for dump creation failures
- Include heap dump creation in monitoring/alerting
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the JVM startup configuration and the admin interface, then review the listed -XX heap-dump flags and HotSpotDiagnosticMXBean.dumpHeap() approach. Done means automatic and on-demand dumps are available in /data/shared/heapdumps/, filenames identify the dump, permissions and failure handling work, and the heap-dump procedures are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100