heap profiling using FollowReference

Hello,

I wrote an agent to get the sum of all reachable objects using JVM TI.

After every 100KB of allocation, FollowReferences() is called and get the sum of all reachable objects. (Of course, it tags visited objects not to count the same object twice.) I can get a heap occupancy graph using this information.

However, it produces a slightly different result, each time I profile heap usage of the same program using this agent.

The application being profiled has a single thread and has no non-deterministic part.

Whats the reason for this variance? What is wrong on my approach?

Toby

[631 byte] By [toby.kima] at [2007-10-3 8:46:45]
# 1
What do you mean by "after every 100KB allocation"? Is this a loop that every Nth object it invokes JVM TI? One possibility is timing issue with finalization.
alan.batemana at 2007-7-15 3:55:46 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...