Java: Tracing classloader leaks
Frank Kieviet has written a very interesting article on how to use existing free tools to
easily track down hanging references to code that has been unloaded from a JVM.
Anyone writing Java code that has to deal with code loading and unloading is probably familiar with problems related to releasing those last dangling references to the code being unloaded - without unloading the code, the classloader won't go away, the memory won't all be released, and the behavior of the JVM when the same code is loaded again cannot be guaranteed...
Somewhere where this particularly bites hard is with JNI code... due to the design of the JNI API, there's a constraint that it's forbidden to load the same JNI library into two different classloaders at the same time... so if you cannot release that last reference to your old classloader, you cannot reload the same code into the JVM without a restart.
There are of course tricks you can play to work around this - for example, you can rename the shared library file so that the JVM doesn't see it as being the same one (I believe that's what the
MLet code in JMX does), but that adds complexity and is rather fragile.
The best thing to do is to track down those reference leaks in your code. Sometimes they can be pretty nasty, other times they're trivial to fix. They're just hard to find.
Until now.Thanks Frank!
( Oct 31 2006, 11:44:33 AM CET )
Permalink

Monday October 23, 2006
snmpv3? JMX!
An interesting tidbit from visit to a customer specializing in monitoring/management of large-scale deployments - few companies in their experience are deploying
SNMPv3-based management solutions.
[
Read More]
( Oct 23 2006, 05:00:00 PM CEST )
Permalink

Friday October 20, 2006
DTrace and moving/rolling averages
A client asked me the other day if
DTrace could be used to maintain a
moving average...
DTrace has very powerful built-in support for various kinds of
aggregations,
including the support for maintaining an average value, But it doesn't have direct support for maintaining a moving average. Here's how to do it...
[Read More]
( Oct 20 2006, 03:00:00 PM CEST )
Permalink

Monday October 09, 2006
Fancy a free in-depth J2EE training course?
There's a free online
J2EE training course that's about to start which is available
here... I'd encourage you to sign up if you want to learn about
J2EE programming!
I'm more of a J2SE and JMX domain expert myself, the work we do is often used in management service tiers and management agent tiers, and it does me some good to make sure I track other technologies. I've signed up and will be following some but not all of the coursework...
( Oct 09 2006, 03:00:00 PM CEST )
Permalink

Tuesday October 03, 2006
Copyrights, Licenses and CDDL Illustrated
I just read
this article describing the differences between some of the common open-source licensing models there are out there.
This resonates with me since we're in the middle of the process of understanding what it means and takes to open-source our work at Sun. Whilst I've already done a lot of open-source work in the more distant past, being a founder of the mklinux project (the first port of linux to the PowerMacs, running on top of the Mach microkernel I originally ported, which is now used in MacOS X and available via Darwin), things have moved on a lot since then!
Licensing is a complex domain, the article makes things very clear. Thanks Chandan!
( Oct 03 2006, 04:00:00 PM CEST )
Permalink