my dog learned polymorphism
The moose likes Beginning Java and the fly likes profiling tutorials Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "profiling tutorials" Watch "profiling tutorials" New topic

profiling tutorials

Stephanie Ll

Joined: Jan 06, 2006
Posts: 4
Hi all!
I'm looking for tutorials on java profiling

I've tried to profile a simple java prog (with only a system.out.println in it )but couldn't make it work.

The java program compiles fine but it's the profiling part that i'm having some probs (i tried to do the profiling on windows)

NOTE: my java version is 1.6
i tried these:
java -prof hello
but got "dumping cpu usage in old prof format ... done"

java -Xrunhprof:cpu samples,thread=y hello
but got "dumping cpu usage by sampling running threads ... done"

I never got the java.hprof.txt file

Why am i getting the dumping msg thing? What do they mean?
What am i doing wrong?? :S
Marco Ehrentreich
best scout

Joined: Mar 07, 2007
Posts: 1294

Hi Stephanie,

do you have a certain reason for doing profiling from the command line? Unfortunately I can't help you with what you are trying to do but I think it would be a lot easier to use an IDE with integrated profiler. That way with only a few mouse clicks your application gets profiled and all data are beautiful visualized and you can additionally filter or sort them in various ways.
I only know the profiler integrated in Netbeans IDE but I'm sure every good modern IDE supports profiling like this.

This is only my opinion and of course it won't help if you have good reasons to do this from the command line...

Stephanie Ll

Joined: Jan 06, 2006
Posts: 4
Well i wanted to try it via the cmd as it's an eg from my lecture and my lecturer told us to try it at home.
I agree. Here's the link:
subject: profiling tutorials
It's not a secret anymore!