Disallowing the dynamic loading of agents by default (revised)

Andrew Dinn adinn at redhat.com
Fri Apr 7 09:47:40 UTC 2017


On 06/04/17 18:48, Alasdair Nottingham wrote:
> I think giving more time to react to the change is good, but I think this just
> provides more notice that dynamic attach will go away, it doesn’t ultimately
> provide a solution for the problems that are currently solved using dynamic
> attach of agents. 

I agree that it provides no such solution. However, I also agree with
John Rose's observation (which may have sailed by you unawares in the
wide ocean this thread has come to occupy) that in the long term there
probably is no such solution.

Eventually, we (yes, Red Hat hope to be involved in this work as much as
Oracle and, no doubt, the other OpenJDK contributors) -- we hope to make
the JVM smart enough to profit from certain guarantees of invariance in
the code base and Jigsaw is one move towards that goal. At some point
that is going inevitably going to mean choosing between the flexibility
offered by transformations effected by dynamically loaded agents or the
performance benefits offered by hard restrictions on such a flexible
runtime. Java -- specifically the JVM -- does an amazing job of coping
with dynamic changes to the code base (not just agents but also lazy
loading and other dynamic reconfigurations to accommodate dynamic code
usage) and that is a great part of its magic. However, Arthur C Clarke
got it right -- to those in the know the magic is actually just a very
advanced technology. Advancing it further is bound to require trade-offs
and compromises where you can't have one without losing the other
(whatever Frank Sinatra says).

> I think just preventing self-attach would be enough. I don’t think you need
> to worry about the hierarchy. If you are going to the lengths of launching new
> JVM’s to attach the agent I’m pretty sure that you have found out that you 
> cannot self attach, and are therefore already in the camp of knowing you are
> doing something bad.

This is a fair point.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the jigsaw-dev mailing list