A java heap/CPU profiling tool
Questions tagged [hprof]
142 questions
9
votes
7 answers
Is it possible to view threads from hprof dump / threads in heap dump
I have got a large (5GB) hprof dump, created by application when OutOfMemoryError occurred. (Using XX: HeapDumpOnOutOfMemoryError ).
Unfortunately there are no logs collected when this error happened. Re-creating this will take couple of hours. …

Jayan
- 18,003
- 15
- 89
- 143
8
votes
1 answer
Starting the Java HPROF profiler on-the-fly programmatically
I am trying to selectively monitor/profile a Java application when certain runtime conditions are met. I am already able to dump the heap on-the-fly using the HotSpotDiagnosticMXBean, which has been quite useful.
I am now trying to do something…

thkala
- 84,049
- 23
- 157
- 201
8
votes
1 answer
Huge byte[] in my app after HPROF
From time to time, especially when implementing new functionalities in my app, I use DDMS + HPROF to analyze memory and heap use. As the App doesn't seem to have any performance-ANR issues and everything works smoothly, initially I didn't care about…

nKn
- 13,691
- 9
- 45
- 62
7
votes
1 answer
OQL syntax for counting objects matching criteria
how can I count objects in Eclipse MAT using OQL syntax?
This doesn't work :
SELECT count(a) FROM org.hibernate.engine.EntityEntry a WHERE (toString(a.entityName)="my.pojo")
(I want to count the number of hibernate pojos loaded into memory)
There…

chamaster
- 135
- 2
- 7
7
votes
3 answers
Where is the heap dump file created by jcmd?
I have tried to take a heap dump using jcmd (from a git bash console window):
$ /c/Program\ Files/Java/jdk1.8.0_202/bin/jcmd 25156 GC.heap_dump filename=livetest-grindtohalt.hprof
25156:
Heap dump file created
However, the file does not seem to…

Robin Green
- 32,079
- 16
- 104
- 187
7
votes
1 answer
Android Studio heap snapshot analyzer - what does "Dominating size" represent?
After dumping heap in Android Studio and viewing the created snapshot, there's a field called "dominating size".
What does it stand for?

Guy
- 12,250
- 6
- 53
- 70
7
votes
0 answers
How to inspect File descriptors leaks in a heap dump hprof file
I have an instance of an app server's heap dump (hprof). How do I use visualvm or any other tool to inspect leaking File descriptors?
I did check the file descriptors in use by running
sudo lsof | grep java | wc -l
When I run the following OOQL I…

user6123723
- 10,546
- 18
- 67
- 109
7
votes
2 answers
Can I compare hprof/jmap dumps with VisualVM?
VisualVM crashes when I try to profile our application with it, but if I could load the jmap memory dumps I've done from our application into VisualVM, I could probably get the answers I need without having to attach VisualVM to our app while it is…

skiphoppy
- 97,646
- 72
- 174
- 218
6
votes
2 answers
Profiling scala for loops using hprof
Word on the street is that for loops in scala are slower than while loops.
Slow:
for (i <- 0 until 10000) {
f(i)
}
Fast:
var i = 0
while (i < 10000) {
f(i)
i += 1
}
How do I use hprof to tell whether the for loops are the bottleneck in my…

dsg
- 12,924
- 21
- 67
- 111
6
votes
1 answer
Meaning of icons in HPROF Viewer in Android Studio
From time to time I use the Memory Monitor and HPROF Viewer in Android Studio to check for any memory leaks and memory usage in general.
I believe I know the meaning of most symbols and colours used in the Viewer, but I would like to be sure and not…

Roy Solberg
- 18,133
- 12
- 49
- 76
6
votes
3 answers
Java profiling: java.lang.Object.hashCode takes half of the CPU time but never explictly called
I have been benchmarked my multihreaded program using -agentlib:hprof=cpu=samples
and was surprised to find the following line in the results:
rank self accum count trace method
1 52.88% 52.88% 8486 300050 java.lang.Object.hashCode
I…

David B
- 29,258
- 50
- 133
- 186
6
votes
2 answers
-XX:+HeapDumpOnOutOfMemoryError not creating hprof file in OOM
I start my java code (1.6.0_16 in Vista) with the following params (among others) -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=../logs. I run the code and I can see in the logs there are two OOM.
The first one I know cause I can see in the…

Persimmonium
- 15,593
- 11
- 47
- 78
5
votes
1 answer
OutOfMemoryError - how to kill the JVM after the hprof created
I want my java to exit when catching OutOfMemoryError, I'm using the -XX:+HeapDumpOnOutOfMemoryError to dump hprof file.
I can't use kill -9 because the JVM needs to be up while dumping the hprof file, is there any way to stop the JVM after…

shaiis.com
- 244
- 4
- 10
5
votes
1 answer
Why can't I get an HPROF dump from certain devices?
As has been detailed by many helpful sites, one way to analyze memory usage of Android apps is to execute a "kill -10 [PID]" to trigger an HPROF dump. This seems to work on some devices, and the logcat normally contains something like…

Rico Yao
- 971
- 7
- 9
5
votes
2 answers
How to open/find a "hprof" dump file created with Android Studio 2.1.3?
I am new to Android Development.
I want to analize the way my application uses memory.
I am developing my application using Android Studio 2.1.3.
I am using Android Monitor to observe the memory ussage and I am trying to create a "hprof" file.
I am…

Liviu
- 83
- 1
- 9