I don't know anything about this agent stuff you're talking about, but if you want to analyze the memory usage of your program, I recommend using eclipse's memory analyzer tool: Eclipse Memory...