Load Time Weaving Memory Usage – 2
Ron Bodkin had been working on reducing the memory usage of AspectJ LTW. He had released an experimental version of aspectjweaver.jar. I ran my tests on it today and the results are very encouraging – the memory consumed does not depend on the number of classes loaded.
Ron told me in private email communication that he is working with Andy Clement to get his changed into AspectJ mainline; I hope we can see Rons fixes soon in AspectJ official release.
Load Time Weaving Memory Usage
I wrote some tests to measure the memory overhead of load-time weaving in AspectJ and AspectWerk. My tests show that the memory required for LTW increases almost linearly for the number of classes loaded (click on the image for a larger version).
The following tests were run:
- Baseline with no AOP tool involved (Plain)
- AspectWerk LTW, with no classes weaved (AW No Weave)
- AspectJ LTW, with no classes weaved (AJ No Weave)
- AspectWerkz LTW, with all classes weaved(AW Weave All)
- AspectJ LTW, with all classes weaved (AJ Weave All)
An interesting observation that can be made from the chart above is that AspectWerkz adds a significant overhead irrespective of whether one uses weaving or not – AspectJ does not seem to have this problem.
AspectJ 1.5.0 and AspectWerkz 2.0 versions were used, and all tests were run on Apple JVM 1.5.0_05.
Two other tests I am planning to run are:
- Test to compare the effect of number of pointcuts matched on the memory overhead
- Test to compare the effect of number of classloaders involved
PS: Ron Bodkin mentioned an experimental low-memory-overhead build of AspectJ in one of his blog posts, but I can't find the file anywhere on WWW. Once I have located it, I will run the tests on that build and publish the results.
Way to go, Abhi
My ex-roommate and good friend Abhilash Shanmugham is made a Microsoft Most Valuable Professional. Way to go, man!
Hello, World!
It was about 5 years ago that I got introduced to the world of blogs. I started reading Java-related blogs on jroller. These days, blogs are major source of tech-related information for me.
At various times, I have toyed with the idea of starting to write a blog myself. Many people I know do write blogs – Vineeth, PC, Swathi etc. People who have known me over the years tell me that I am a very opinionated person. But I am a very lazy person too; hence I have never bothered to set up a blog and start writing so far. 🙂
Not anymore!