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
3
votes
0 answers

why jmap command running with exception java.lang.reflect.InvocationTargetException?

When I am running this command jmap -heap 12671 on linux to see the current heap size of a java application running on my system then after displaying prem space information this exception is coming Exception in thread "main"…
3
votes
1 answer

JMapFrame and GUI [Java]

Ok,hello everyone, First I'll show what I have: I have this code: public static void main(String[] arg) throws IOException { map = new DefaultMapContext(); map.setTitle("Visualizador UD - Geotools"); mapFrame = new JMapFrame(map); …
Castiblanco
  • 1,200
  • 4
  • 13
  • 32
3
votes
4 answers

Can jmap -histo trigger full garbage collection?

We know that jmap -histo:live triggers a full gc in order to determine live objects: Does jmap force garbage collection when the live option is used? Since jmap -histo considers all objects in the heap (those in the young and old generation), my…
kuloglan
  • 301
  • 1
  • 4
  • 7
2
votes
0 answers

jmap -histo:live output is empty

Sometimes when I execute a command: "$JAVA_HOME/bin/jmap -histo:live " + pid + " > " + fileName I get an empty(blank) file. Why this may happen? P.S. This is using in autotest (test on memory leaks). With option -F (forced) I get histogram, but it…
kornero
  • 1,109
  • 8
  • 11
2
votes
0 answers

jhsdb can't attach the java process in MacOS Monterey

macOS Monterey version is 12.5 and jdk version is 11 I was going with sudo jhsdb jmap --heap --pid xxxx to analyze java process. Then I got the error followed Password: Attaching to process ID 47413, please wait... ERROR: attach: task_for_pid(47413)…
MMMMMCCLXXVII
  • 571
  • 1
  • 8
  • 23
2
votes
2 answers

jps not listing tomcat process and jmap fails to create heap dump

I have running tomcat (9.0.39.0) server, started by user cpappt and running with pid: 1682650. The machine on which this server runs is not bare metal but a VMware machine and the JVM is from OpenJ9 > ps -ef | grep Bootstrap cpappt 1682650 1…
morecore
  • 900
  • 3
  • 14
  • 32
2
votes
0 answers

is there any way to show jmap dump progress in executing

Is there any possible way to show jmap dump progress? I am using this command to dump stack: /opt/dabai/tools/jdk1.8.0_211/bin/jmap -F -dump:format=b,file=my.dump 5307 the output is: [root@log001 ~]# /opt/dabai/tools/jdk1.8.0_211/bin/jmap -F…
Dolphin
  • 29,069
  • 61
  • 260
  • 539
2
votes
0 answers

Cross Docker Communication - Get a Jmap dump from another container

I've been working on this for a few weeks but now I'm kind of stuck. I currently have two docker containers. Both of them are running the following java version: Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM…
2
votes
0 answers

how to solve the ptrace_scope on mac

I'm using mac os 10.13.2 When I execute jmap I got an error: ➜ ~ jps 34819 35626 Launcher 35627 DataportalApplication 35899 Jps ➜ ~ ps -efj 35627 UID PID PPID C STIME TTY TIME CMD USER PGID SESS JOBC STAT TT …
Ke.Steve
  • 39
  • 4
2
votes
1 answer

jmap -histo with a specific object at Windows

While testing my jar application at Linux I use the command line below to track the usage/memory load of a specific object (eg JButton). jmap -histo:live | grep JButton Which results: 35: 24 11136 javax.swing.JButton 99: …
Zerthimon
  • 435
  • 1
  • 9
  • 19
2
votes
4 answers

How to run jcmd without the JDK?

I'm trying to figure out how to drop jcmd.exe on a windows server installed at a client site so that we can troubleshoot heap and thread issues. Don't really want to install the full JDK since it complicates the environment. jcmd.exe definitely…
DaveyBob
  • 253
  • 1
  • 3
  • 8
2
votes
1 answer

Convert .dmp file to .hprof file

I have tried running the command jmap -dump:format=b,file=jvm.hprof core.20170103.212745.20453.0007.dmp But i get an error Error attaching to remote server: java.rmi.UnknownHostException: Unknown host: core.20170103.212745.20453.0007.dmp; nested…
Prateek Narendra
  • 1,837
  • 5
  • 38
  • 67
2
votes
0 answers

Disastrous bug when running jinfo and jmap

When I run jinfo or jmap to any Java process, it will "suspend" the Java process. It's 100% reproduced for the long running processes. Here're the detailed steps: Pick a Java process which is running over 25 days(It's wired because this doesn't…
tobe
  • 1,671
  • 2
  • 23
  • 38
2
votes
0 answers

java heap histogram from inside of program

How can I invoke heap-dump from my Java program as similar to what jmap produces with "-histo" option. As far as know heap-dump in binary form (or like output from "-dump" option of jmap) could be handled by using HotSpotDiagnosticMXBean, but not…
2
votes
1 answer

Counting classes & permgen using, using permstat

I want to count the number of classes and the permgen space of my java code using jmap. However since I am running my code in ecplise , additional classes and permgen space (which belongs to ecplise ) is being shown. I tried to run the code from my…
Suraj Menon
  • 1,486
  • 3
  • 28
  • 50