JOL object header information

Rafael Winterhalter rafael.wth at gmail.com
Wed Dec 17 14:41:13 UTC 2014


I agree to 99%.

But this other approach only works if VMSupport was loaded by the system
ClassLoader where agents must be loaded from. Otherwise, the VMSupport that
is the agent and the VMSupport that installs the agent are two different
classes and the set INSTRUMENTATION field would belong to a different
class. This is why I prefer the hack by adding an additional installer
class that is minimal in byte size and does not carry any other class
dependencies and inject this class. Also, I only access it by reflection in
order to avoid these class identity issues. Might not be as relevant for
JOL as I guess most people do not really use this from a servlet container
or somewhere but I guess there might be corner cases (?).

2014-12-17 15:16 GMT+01:00 Serkan ÖZAL <serkanozal86 at hotmail.com>:
>
> Nice hack Rafael +1
>
> But I think, instead of creating agent jar file on the fly, it maybe
> better that JOL jar itself can be an instrumentation agent jar by just
> adding a few lines its MANIFEST file.
>
> On 17 Dec 2014, at 15:56, Rafael Winterhalter <rafael.wth at gmail.com>
> wrote:
>
> > Well, obviously, I can do better than Serkan ;)
> > Self-attachment, for your consideration:
> > https://gist.github.com/raphw/05785c61b2b3dd263224
> >
>
>


More information about the jol-dev mailing list