cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ineon
Journeyman III

CodeSleuth profiler 'not profiling'

I've just tried using the CodeSleuth eclipse plugin to profile a multi-threaded simulation that I've been working on. I followed the steps on the help, but I am unable to get the profiler profiling.

The profiler says that the profiling is complete just after it has started. The original program should take around 120 seconds, so I'm thinking that the program doesn't run. I tried putting

FileWriter out = new FileWriter ("testOut.txt");
out.write ("hello world");

at the start of my main function and then profiling, and I didn't get my outputfile.

I've tried the profiler with different settings to no avail. Even with ludicrusly long duration (~age of the universe) the profiler finishes almost instantaneously.

The .ca file is mostly empty too. The Navigation View says that it just contains "Dynamically Generated Code" which does not expand to show anything else.

The feeling that I get from the documentation is that it 'just works!', so have I missed something?

Thanks in advance

0 Likes
1 Reply
gfrostamd
Staff

CodeSleuth (and CodeAnalyst) both require the code being profiled to have been compiled (sometimes called jit'ed) before we can collect profile information.

So some code (for example most 'hello world' style snippets) will never be jitted because the code is just handled by the JVM's interpreter.

My guess is that this code is not being 'compiled' by the JVM, so you get no profile data for it.

BTW just adding Thread.sleep() to delay the code does not help. The Thread.sleep() will be handled very efficiently by the JVM and will not cause the caller to become compiled.

Try moving your code out to a function and call it say 1000 times. Sun's JVM should compile the code when this method gets 'hot'.

Some JVM's have command line flags to 'force compilation', you might be able to turn that on.

Gary
0 Likes