Questions tagged [jmap]

A Hotspot JVM command-line utility that prints memory-related statistics for a running JVM or core file.

jmap is a command-line utility that serves as a tool for troubleshooting various memory-related issues in a Java Virtual Machine (JVM). jmap is distributed as a part of Oracle's Hotspot JVM, and so it can be used only for the Hotspot JVM.

jmap usually prints memory-related statistics for a running JVM or core file. Typical uses of jmap are :

  • jmap -histo <jvm-pid> - which prints class histogram of the instances present in the heap
  • jmap -heap <jvm-pid> - which prints a heap summary

A full list of command line options is available here.

163 questions
1
vote
0 answers

jmap -histo error message "Not enough memory"

When trying the command jmap -histo in servers, getting an error message "not enough memory to process this command". I know that taking -histo will give a small file. But its just giving the error message. Can anyone please suggest me in taking…
1
vote
2 answers

JMap dump format specification

Are there any open specifications for jmap heap dump format? Thanks for help!
pbespechnyi
  • 2,251
  • 1
  • 19
  • 29
1
vote
1 answer

Will Java memory leak always show up in old gen consumption?

I've been debugging what I was told was a "memory leak" but comparing the old gen graphs of the bad build and the good build, they look almost identical. Is it safe to call this as not a memory leak or is there something else I could be missing?
juananneother
  • 155
  • 1
  • 1
  • 5
1
vote
1 answer

jmap and object size

I run jmap on my JVM to try to understand some memory leaks and I discovered something strange : the java.lang.Long use 24 bytes instead of 8 !!! Can some tell me where is my mistake ? num #instances #bytes class…
Ektor
  • 163
  • 1
  • 7
0
votes
2 answers

Can I set up profiles like jhat or jmap to take snapshots at regular intervals or whenever exception is detected

So basically in our case the server goes down mysteriously and we often restart it and it starts to work fine. Till now we haven't been able to establish a pattern. Looking at thread dump did help but we want to analyse memory usage too. Can these…
Smiles in a Jar
  • 479
  • 1
  • 6
  • 20
0
votes
1 answer

Basics of Jmapping?

I've done some search out there but couldn't find too much really helpful info on it, but could someone try to explain the basic of Java memory maps? Like where/how to use it, it's purpose, and maybe some syntax examples (inputs/outputs types)? …
trflach
  • 98
  • 1
  • 8
0
votes
0 answers

sh: jmap: not found

I am using Alpine Linux v3.12 and openjdk 11.0.9 I am trying to execute the command below: jmap -dump:live,format=b,file=application_heap_dump.bin getting sh: jmap: not found I tried to install jmap but couldn’t find anything apt-get…
0
votes
1 answer

How do I install jhat?

I have downloaded Java JDK 17 and I need to analyse a dump I did with the jmap command. I have searched about how to do it and jhat is apparently an already installed command that lets you analyse the dumps from jmap but when I run the jhat command…
Mr.D
  • 79
  • 6
0
votes
0 answers

Why does taking a heap histo using OnOutOfMemoryError hang?

When the JVM (OpenJDK 18) throws an OutOfMemoryError, I want to make sure it stops and we take a heap histogram using jmap. I achieve that with the flags -XX:-ExitOnOutOfMemoryError -XX:OnOutOfMemoryError=/usr/bin/jmap -histo:live $jpid && kill…
TTT
  • 6,505
  • 10
  • 56
  • 82
0
votes
0 answers

su -c command fails in shell script

I was trying to generate a heap dump by the script below. The jmap command works from the cmd. But it fails if I run by the script. Any idea why? #!/bin/bash # Check to ensure we're running as root. if [[ $EUID -ne 0 ]]; then echo "This script…
Zhang
  • 39
  • 1
  • 6
0
votes
0 answers

Convert a core file dump into a heap dump

I have an taken a core dump file from a machine, with file size 2GB. I can open this file with gdb and see the processes that were running when I took the core file. I want though to convert this file into a heap dump in order to see more useful…
0
votes
1 answer

Jmap does not have the file parameter, so the execution is abnormal. However, the execution is normal after the file parameter is added

The specific exception information is as follows: root@test-6cf7db85b7-sxk8h:/# jmap 7 Attaching to process ID 7, please wait... ERROR: ptrace(PTRACE_ATTACH, ..) failed for 7: Operation not permitted Error attaching to process:…
0
votes
3 answers

How to use jmap heap

I have seen in tutorials, that with command jmap -heap, I can receive info about heap state. Now this command is unavailable. There are only jmap -dump:live,format:b,file=heap.bin but it save data to unreadable bin format. How can I receive…
0
votes
2 answers

running a linux command against a pid inside k8 pod

Is it possible to run a linux command against a process which is running inside a kubernetes pod. Example: I want to grab heapdumps on a java process running inside a k8 pod. The pod comes with minimal installation and does not have that much disk…
colossal
  • 529
  • 1
  • 5
  • 22
0
votes
1 answer

jdk1.6 JMAP.EXE: Remote thread failed for unknown reason

I get this error when using the following batch file to take a core dump of a Java service running in a Windows console shell: The parent directory name of this script is: MyDIR Install dir is: C::\InstallDIR The process id of window called…
djangofan
  • 28,471
  • 61
  • 196
  • 289