---
title: Obtaining Java Heap Dumps
description: You can automatically save heap dumps on OutOfMemoryError by using the following options with the java command:
---

[Skip to content](https://support.diffusiondata.com/knowledge/obtaining-java-heap-dumps#main-content)

English

Show submenu for translations

[Contact Customer Support](https://support.diffusiondata.com/knowledge/kb-tickets/new?hsLang=en) [Customer portal](https://support.diffusiondata.com/tickets-view?hsLang=en)

[![DiffusionData Logo](https://support.diffusiondata.com/hs-fs/hubfs/DiffusionData-Logo-Primary-Trimmed.png?width=445&height=64&name=DiffusionData-Logo-Primary-Trimmed.png)](https://www.diffusiondata.com)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- [Contact Customer Support](https://support.diffusiondata.com/knowledge/kb-tickets/new)
- [Customer portal](https://support.diffusiondata.com/tickets-view)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center](https://support.diffusiondata.com/knowledge?hsLang=en)
2. [Support](https://support.diffusiondata.com/knowledge/support?hsLang=en)

# Obtaining Java Heap Dumps

### Automatic Heap Dumps

You can automatically save heap dumps on OutOfMemoryError by using the following options with the java command: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=../logs Diffusion does this by default, saving the dump file in the /logs directory.

### Manual Heap Dumps

To take a heap dump for some reason other than OutOfMemoryError, follow the procedure below:

#### 1. Find process ID

To obtain a Java heap dump of a running VM, you first need to find out the PID (process id) of the Java VM process that is running Diffusion. On Windows, you can do this by opening Task Manager, going to the **Processes** tab and looking in the PID column. On Linux, you can find it by running the jps tool from the command line. The output will include a line similar to this: 4315 Diffusion where the number is the PID you need.

#### 2. Run jcmd command

From a console, run the following command: jcmd \<pid\> GC.heap\_dump heap.bin This will save a heap dump to a file called heap.bin.

#### Resources:

[Java HotSpot VM Command-Line Options](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/clopts001.html) with more detail about -XX:HeapDumpOnOutOfMemoryError [Finding the process ID on Windows](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/finding-the-process-id), including alternatives to using Task Manager [Full documentation for jps](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jps.html) [The jcmd Utility](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr006.html)

- [Administer](https://support.diffusiondata.com/knowledge/administer?hsLang=en)
- [Build](https://support.diffusiondata.com/knowledge/build?hsLang=en)
- [Getting Started](https://support.diffusiondata.com/knowledge/getting-started?hsLang=en)
- [Install & Upgrades](https://support.diffusiondata.com/knowledge/install-upgrades?hsLang=en)
- [Management & Monitoring](https://support.diffusiondata.com/knowledge/management-monitoring?hsLang=en)
- [Security](https://support.diffusiondata.com/knowledge/security?hsLang=en)
- [Support](https://support.diffusiondata.com/knowledge/support?hsLang=en)
- [Troubleshooting](https://support.diffusiondata.com/knowledge/troubleshooting?hsLang=en)
- [Cloud](https://support.diffusiondata.com/knowledge/cloud?hsLang=en)

[![Chill listening crop-3](https://support.diffusiondata.com/hs-fs/hubfs/DiffusionData%20Favicon.png?width=24&height=24&name=DiffusionData%20Favicon.png "Chill listening crop-3")](http://diffusiondata.com)

diffusiondata.com Help Center

Copyright © 2026, DiffusionData