Agent and sizing
Alan Bateman
Alan.Bateman at oracle.com
Fri Oct 13 06:42:27 UTC 2017
On 13/10/2017 07:11, Remi Forax wrote:
> Hi Henry,
> technically, scanning all the fields of a class is warning free,
> but to compute the size, you need the actual value of the fields, so you need to extract the value of a field, even if it's a private field, and this get you a lot of warning (or error).
>
If there are warnings then he must be using the reflection API to access
fields in the JDK classes that should not be accessible. This should not
be an issue for java agents as the Instrumentation API has support for
redefining modules and opening specific packages to the agent module.
There are lengthy threads on jigsaw-dev going back to 2015 on this
topic. As always, the integrity busting power of the Instrumentation API
is something that agent developers need to guard, the Instrumentation
object should not be leaked to libraries or applications.
-Alan
More information about the jdk9-dev
mailing list