Trace object allocation flag proposal

Xiaobin Lu jacklusf at gmail.com
Tue Dec 14 23:07:10 PST 2010


Hi folks,

I would like to propose a way to trace object allocation on Linux. On
Solaris, we have DTrace which is pretty nice. But on Linux, it is almost
impossible to do so. Correct me if I am wrong here.

So I am thinking to add a manageable VM flag and let's call it
TraceObjectAllocation. When enabled, we can output something like:

thread id: 10     class name: java/lang/reflect/Method             size: 80
bytes
thread id: 10     class name: [Ljava/lang/Class;                    size: 16
bytes
thread id: 10     class name: [C
                         size: 56 bytes
thread id: 10     class name: java/lang/reflect/Method            size: 80
bytes
thread id: 10     class name: [Ljava/lang/Class;                   size: 16
bytes

As you could imagine, this could be very useful to keep track of object
allocation behavior in the app. Some smart tool can take advantage of this
to print a histogram (like top 10 hot allocations) of object allocation. I
would like to know your thoughts and suggestions on this.

I have a detailed proposal on this attached in PDF file.

Thanks,

-Xiaobin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20101214/419ee86d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Traceobjectallocationondemand.pdf
Type: application/pdf
Size: 274217 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20101214/419ee86d/attachment-0001.pdf 


More information about the hotspot-runtime-dev mailing list