New candidate JEP: 451: Prepare to Disallow the Dynamic Loading of Agents

Ron Pressler ron.pressler at oracle.com
Wed May 17 11:47:52 UTC 2023



> On 16 May 2023, at 16:36, Jack Shirazi <jacks at fasterj.com> wrote:
> 
> Thanks, "These warnings aim to prepare users for a future release which disallows the dynamic loading of agents by default" is pretty clearly deprecating frictionless agent loading. The non-goal part is the attach API, not agent loading.
> 
> I understand the motivation, and have listed multiple reasons why I feel they are insufficient. But again, I'm happy to accept that my opinion may be the minority, or may be the majority. I'm saying let's try to find out

A couple of clarifications:

1. The “frictionless” loading of agents after startup (aka “dynamic loading”) by libraries has been disabled by default in the JDK for the past four and a half years, and it has been impossible for libraries wishing to gain the power of agents not to notice they had to  to hack around around that intentional limitation in JDK 9 and later. None of the techniques that such libraries employ could even remotely be described as “frictionless” (e.g. starting a child process that masquerades as a serviceability tool and attaches to the parent process to inject the library’s agent into the parent process).

2. The assumption is that a minority of serviceability use cases actually require a dynamically loaded agent *by reasonable necessity* (i.e. their use is significantly hindered by loading an agent at startup) rather than by choice.

— Ron


More information about the jdk-dev mailing list