dacongy
dacongy

Reputation: 2552

allocation annotated heap dump

Is there any existing tool that can take Java heap dumps with allocation site annotations? With such a heap dump, we can aggregate runtime objects by their allocation site (roughly speaking, the new statement that creates the object), in addition to aggregation by class type.

Suppose this kind of heap dump is available, do you think it is more useful for leak debugging?

Upvotes: 3

Views: 237

Answers (1)

Amir Afghani
Amir Afghani

Reputation: 38541

I helped build this feature into HPjmeter - but it was a platform specific feature (meaning it was only available on Itanium/HP-UX). It's useful to solve specific types of problems (e.g identifying sites that are doing heavy short term allocations and contributing to GC pressure). For most leaks, the leaking object dominates your object graph, and your standard tools will help visualize this.

In the unlikely event that this is indeed your development environment, the flag to collect this data is PrintAllocStatitistics (again, platform specific!):

 java ... -XX:+PrintAllocStatistics -Xverbosegc[0|1][:file=[filename[,[n][h][d][u][t]]]]

You can also read more about this capability in the online documentation. Search for Allocation Statistics

Upvotes: 2

Related Questions