Monday, February 6, 2012

Update to the Allocation Instrumenter

A couple of years ago, I open-sourced a tool that lets you instrument all of the allocations in your Java program. Some quick updates today:
  1. It now supports JDK7.
  2. You can now optionally use it to instrument constructors of a particular type, instead of allocations. So, if you wanted to find out where your Threads were being instantiated, you could instrument them with a callback that invokes Thread.dumpStack().

I know that most of the readers of this blog are more interested in concurrency, and that it has been a very, very long time since I posted. The spirit is willing, but the flesh is insanely busy... I have it in mind to do a post that discusses a bunch of strategies for doing efficient non-blocking concurrency in C++, because the attempts are very amusing, but I haven't had the chance to sit down and do it.

6 comments:

Vladimir Dolzhenko said...

I do really like that instrumenter - I've made garbage-free logger and prove using it that it's really garbage-free.

It's very specific for latency critical execution path only and it's definitely not a general purpose logger as log4j or so.

( going to release it under apache license soon )

Anonymous said...

Welcome back Jeremy!

It would be great if you write a few blogposts on effective use of java collections. I saw that you were able to use them effectively to improve performance , scalability in a google paper about scala/c++/java

Vignesh

Jeremy Manson said...

@Vladimir: Glad it helps. I've used it to track down excess garbage in our applications, too. I've since replaced it with something that would be difficult to open-source right now, but it is still pretty useful.

@Vignesh: I'm probably not as back as I would like. My life is getting busier, rather than less busy, and there are complications that prevent me from posting everything I might like right now.

Having said that, I did talk about the Scala paper here:

http://jeremymanson.blogspot.com/2011/06/scala-java-shootout.html

Vladimir Dolzhenko said...

@Jeremy

gflogger is opened now.

Jeremy Manson said...

Cool! Glad it could be of help.

mchr said...

I just came across this post and thought you might be interested to know about a similar tool which I wrote to track object allocation and object lifetimes: http://mchr3k.github.com/org.inmemprofiler/