JVM可以提供快照持久化吗?
是否可以转储正在运行的 JVM 的映像,然后通过将映像加载到 JVM 来恢复之前的状态?我相当肯定答案是否定的,但我很想弄错.
Is it possible to dump an image of a running JVM and later restore the previous state by loading the image into the JVM? I'm fairly certain the answer is negative, but would love to be wrong.
随着 JVM 可用的所有动态语言增加了交互性,能够保存编码会话将有助于节省手动将 VM 恢复到先前会话的时间.
With all the dynamic languages available for the JVM comes an increase in interactivity, being able to save a coding session would help save time manually restoring the VM to a previous session.
推荐答案
有一个JSR 323 建议 不久前,但它是 被拒绝.您可以在这些文章中找到一些链接,了解这背后的研究及其需要采取的措施.它大多被认为是一个太不成熟的想法而被拒绝.
There was a JSR 323 proposed for this a while back but it was rejected. You can find some links in those articles about the research behind this and what it would take. It was mostly rejected as an idea that was too immature.
我听说至少有一家初创公司(遗憾的是不记得名字了)正在通过虚拟机管理程序(可能是 Xen)开发虚拟化技术,该虚拟化技术已经非常接近能够移动 JVM,甚至包括类似的东西文件系统参考和套接字端点.因为他们处于管理程序级别,所以他们可以访问所有这些东西.通过将它和 JVM 挂钩,他们拥有了大部分内容.我认为他们可能已经破产了.
I have heard of at least one startup (unfortunately don't recall the name) that was working on a virtualization technology over a hypervisor (probably Xen) that was getting pretty close to being able to move JVMs, including even things like file system refs and socket endpoints. Because they were at the hypervisor level, they had access to all of that stuff. By hooking that and the JVM, they had most of the pieces. I think they might have gone under though.
您今天可以获得的最接近的东西是 Terracotta,它允许您将 JVM 堆的一部分集群化,并将其存储在服务器阵列中,可以使其持久化.在 JVM 启动时,您连接到集群并可以继续使用指定为集群的堆的任何部分.实际对象会根据需要进行故障处理.
The closest thing you can get today is Terracotta, which allows you to cluster a portion of your JVM heap, storing it in a server array, which can be made persistent. On JVM startup, you connect to the cluster and can continue using whatever portions of your heap are specified as clustered. The actual objects are faulted in on an as-needed basis.
相关文章