简体   繁体   English

在ANOTHER JVM中获取已加载的类

[英]Get loaded classes within ANOTHER JVM

I'd like to be able to read data from a separate JVM (essentially "peek" into it) at will so I can read specific class instance values and/or invoke methods. 我希望能够随意从单独的JVM(本质上是“窥视”)读取数据,以便可以读取特定的类实例值和/或调用方法。 I've looked into using both agents and the attach API but each of them seems to only be designed for runtime instrumentation and not being able to grab the actual instance itself. 我已经研究了同时使用代理和附加API,但是它们似乎仅是为运行时检测而设计的,无法获取实际实例本身。

An instance of an object only exists in one JVM if you use managed memory. 如果使用托管内存,则一个对象的实例仅存在于一个JVM中。

If you use a data structure which uses shared memory, you can do this eg Chronicle Map This makes memory accessible to multiple JVMs, but only by using off heap, shared memory. 如果使用使用共享内存的数据结构,则可以执行此操作,例如Chronicle Map。这样可以使多个JVM可以访问内存,但只能使用堆外共享内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM