是否可以在不请求该JVM的情况下从另一个JVM的内存访问对象? [英] Can I access object from another JVM's memory without requesting that JVM?

查看:58
本文介绍了是否可以在不请求该JVM的情况下从另一个JVM的内存访问对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以访问其他JVM的Heap内存?如果我知道内存引用/地址,这可能吗?

Is there any way we can access other JVM's Heap memory? Will this be possible if I know the memory reference/address?

推荐答案

有什么方法可以访问其他JVM的Heap内存?

Is there any way we can access other JVM's Heap memory?

我想您正在考虑做类似创建共享内存段并将其映射到两个JVM的地址空间之类的事情.

I imagine you are thinking of doing something like creating a shared memory segment and mapping it into the address space of two JVMs.

它不起作用.您可以使用JNI创建和映射共享段,但是您将无法说服两个JVM使用该内存作为堆内存.而且,如果您克服了这一障碍,那么由于各自的JVM的内存分配器和垃圾收集器相互干扰,这一切都会变得非常错误.

It won't work. You could use JNI to create and map the shared segment, but you won't be able to convince the two JVMs to use that memory as heap memory. And if you got past that hurdle, it would all go horribly wrong due to the respective JVM's memory allocators and garbage collectors interfering with each other.

如果我知道内存引用/地址,这可能吗?

Will this be possible if I know the memory reference/address?

那没什么区别.

这篇关于是否可以在不请求该JVM的情况下从另一个JVM的内存访问对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆