This article explains ways to force the machine, your HiveMQ broker is running on, to create a heap-dump of the current HiveMQ process. Creating heap-dumps puts a certain amount of strain on your system and therefore we will be looking at typical pitfalls and best practises.
Do not create a heap-dump on your production system unless a member of the HiveMQ Support team clarified the action with you!
Instructions
HiveMQ 3.x (JDK 8+)
Find the processID <pid> for the HiveMQ process by running:
ps aux | grep hivemq
Run
jmap -dump:file=heap.bin <pid>
Alternative:jcmd <pid> GC.heap_dump filename=heap.bin
Compress the heap.bin file and upload it to your HiveMQ Support Ticket
HiveMQ 4.x (JDK 11+)
Find the processID <pid> for the HiveMQ process by running:
ps aux | grep hivemq
Run
jhsdb jmap --binaryheap --dumpfile heap.bin --pid <pid>
Alternative:jcmd <pid> GC.heap_dump /opt/hivemq/heap.bin
Compress the heap.bin file and upload it to your HiveMQ Support Ticket
Inside a Docker Container
curl -L https://github.com/apangin/jattach/releases/download/v1.5/jattach > jattach && \ chmod +x jattach && ./jattach 1 dumpheap heap-dump.hprof
Make you sure a running these command with a user that has sufficient permissions i.e. root or the HiveMQ run user.