A few weeks ago, I started a project called “PYP – Promote Your Project”. Its about how the employees at codecentric use their 20 percent time and which projects they pursue. As a start to my blog series, I talked with Fabian Lange from Solingen about his project, the Allocation Tracker .
Hi Fabian, thanks for taking the time to talk about your project, the „Allocation Tracker“. Tell me about it.
The Allocation Tracker is a java agent which was written to solve problems with the Java garbage collection. It’s not about memory leaks, but about not generating that much garbage so that the garbage collection process can be relieved.
At a customer, we had about 8GB/s of garbage, which was simply too much and couldn’t be handled anymore. Therefore I wrote the Allocation Tracker. I’d like to improve it and hope it can be useful to my colleagues.
The Allocation Tracker modifies the Java classes loaded by the JVM and adds additional logic in terms of bytecode, which basically counts the constructor calls.
It’s written in Java with the help of ASM as bytecode manipulation library and controlled by an JMX bean. You can look up what it can do and what it won’t do at the Github repository or by reading my blog post .
You’ve chosen an unusual approach, why didn’t you use the common tools?
There are a lot of possibilities to identify such problems, but most of them are to expensive for high performance environments because they collect too much data. For example JProfiler has a lot of features and I use it regularly, but it’s certainly not suited for a production system.
This is the sweet spot for the Allocation Tracker, it performs very well under high load because it just does one job. A typical one-trick pony.
Which features and improvements are you planning for the future?
I definitely want a benchmark suite and a bunch of compatibility tests for the various JVM implementations out there, including suitable blacklist for core JVM classes. We need them, because the agent should never instrument them to prevent class loader issues and crashes.
Additionally, as I said before, the Allocation Tracker is controlled by a JMX bean, but it is possible there is a more elegant solution for that.
A few days ago someone suggested it would be nice if this tool would work on Android, too. Due to the fact that it’s written in Java, it seems natural that it would run on Android too, but the JVM and the Android runtime have a lot of differences, so we have to experiment with that and try to find a way.
How can interested colleagues participate?
There are a lot of issues in Github you can take a look at and work on, if you want to. About some of them I’d like to talk first, so feel free to contact me. It would be great if you could use the Allocation Tracker in other projects to prove it’s suitable for daily use and get some feedback on it.
Participating in a Github project might be a big hurdle…
The hurdle is not that big: git clone, mvn eclipse:eclipse, after that you can open the project, code and submit pull requests. I admit, you probably don’t know how to start or what to do with it at first so it’s a good start to just try it out and see what it does.
Writing benchmarks is by the way something you can do without getting too involved in coding.
A word about open source. I hear a lot about „Open Source by codecentric“ (mostly in context with you). What does this mean to you?
I am very often annoyed by bugs in the software I use, closed source as well as open source. If not a software developer, then which person is more qualified to give constructive and detailed feedback on software projects?
Open source has the benefit that I can do something about the errors I find. In my opinion, when you get involved at this point, you can create value for yourself and others. Many of our customers are also open source users, so they profit from our contributions and fixes as well. I have about 30 contributions at Vaadin (editor’s note: https://github.com/vaadin/vaadin/commits?author=CodingFabian) which cost me a great deal of work and I am still waiting for the release notes of Vaadin 7.2.5, which has a lot of patches from us. We also made contributions to Spring, Apache Commons, Weld…
You will probably get a similar answer from Benedikt Ritter when you ask him why he participates at Apache Commons: it’s important to contribute to open source because you will learn a lot from that and build codecentric’s reputation in the open source community.