snapshot time

Questions about YourKit Java Profiler
Post Reply
cheechee
Posts: 2
Joined: Fri Dec 03, 2004 2:31 am

snapshot time

Post by cheechee »

I am a newbie to yourkit ( and to profiling itself). I am investigating 'outofmemory' error in my j2ee appln. I want to observe the memory usage over a period of time. I am using the sampling method. I guess, the snapshots interpret the state exactly at the moment when the snap is taken and not the continuos state over a period of time. Hence I will not be able to see the behaviour over a period of time.

Also, yourkit looks like a very good profiler at the micro level, but macro level - like profiling for a period, or UIs with graphs (charts) is not there.

Please throw some light. If I am ignorant or wrong anywhere totally, pl let me know.

Help is appreciated at the earliest. If I succeed in getting to use yourkit well, my company may buy it.
Vladimir Kondratyev
Posts: 1626
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

You are talking that you are using sampling for emory profiling. "sampling" is a one of CPU profiling methods.

Couldn't you please formulate your task in more details.
cheechee
Posts: 2
Joined: Fri Dec 03, 2004 2:31 am

Post by cheechee »

Hi
thanks for reply.

My task description: I will define from the problem point of view.

My J2EE appln experiences OutOfMemoryError now & then. No idea abt where(whih code) it happens. There is no pattern at all. Hence my idea was to observe the memory over a period of time (say 1 to 2 days), and then check the mem usage later to see whether the mem shot up at the point where OOM happened or was it accumulating slowly, due to some other task. (snap shot). Since this sounds more like a macro view, I thought graphs charts will be more helpful.

Once I find the time when problem started, then I can go into micro views (like with the snapshots - which fns were executing then, unrefernenced objects count, method time, etc).

Yes...sampling cannot be used here...thansks for the correction. So what would u suggest.
tombrus
Posts: 27
Joined: Wed Dec 01, 2004 8:53 pm

Post by tombrus »

Check out jconsole (JDK 1.5), I think you would like it.

-Tom
jagadeesh
Posts: 5
Joined: Wed Nov 17, 2004 11:29 pm

Post by jagadeesh »

I understand your issue, I had the same issue in the begining. The profiler UI does not have a policy based snapshot mechanism. You can not program through the profiler UI to take periodic snapshots. But you can do it with your own program quite easily. I manipulated the example program that came with the distribution to come up with a Java program that took snapshots every 5 minutes. I ran this overnight and collected a bunch of snapshots. I also had an analsys routine in that program which I used to process these snapshots to generate a bunch of data that could be imported into excel spreadsheet for drawing charts and graphs.

The beauty of this is the extremely low overhead this process causes on the application. You can run your application at boundary conditions and still profile the memory.
Post Reply