The Source for Java Technology Collaboration
User: Password:



Mark Lam's Blog

Testing Archives


Async Thread Dumps on CVM

Posted by mlam on June 22, 2007 at 01:45 AM | Permalink | Comments (5)

There are times in the course of your development effort when your application just seems to hang forever. At those times, you wish you had some way of knowing where the hang is occurring. If you're running on JavaSE, chances are you'll have a lot of advanced tools that makes life easy for you. But if you're running on an embedded device, suddenly, your options are now severely limited. For the phoneME Advanced VM (CVM), there's a way to get help on this even when there is not advance debugging support on your device.

What I'll be showing here is an old trick to get an asynchronous dump of the stacks of all the threads that are currently alive in the VM. First of all, you need to know that this is a hack i.e. it's not good and clean code. That's why I haven't already committed it to the source repository, and won't be doing so. The reason it is a hack will be explained below later under Why this is a Hack!!!. But even though it is a hack, it is useful when you need it. Many of my colleagues as well as customers have often asked me for the code patch for this hack to help with debugging the hangs in their applications. I figure you might find it helpful too.

So, here it is ...

Continue Reading...





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds