For instrumenting a loaded class, you must use HotSwap
provided by Sun's JVM. An upcoming new version of
Javassist provides a utility class for using HotSwap.
So if you are intrested, please down load the CVS HEAD
and test it.
Thanks very much!
I've gotten the code from CVS and taken a look at the HotSwapper. Do you have any sense of what sort of overhead running the virtual machine in this kind of debug mode adds?
According to our experiment with HotSwap of JDK1.4
(JDK1.4 has HotSwap although it has a different name),
the overheaeds is less than 5% (normally about 2%).
We used SPECjvm98, which is a set of relatively small
programs. So if you run a really big program, the amount
of the overhead may change. I expect the overhead
will be still negligible, though.