是否保存进程的内存以供以后使用? [英] Save a process' memory for later use?

查看:59
本文介绍了是否保存进程的内存以供以后使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以暂停进程,将内存内容保存到文件中,然后在以后重新加载文件,以便您可以继续执行程序?

Is it possible to pause a process, save the memory contents to a file, and then later reload the file so you can continue the program?

修改 我一直在阅读有关此内容的信息:

Edit I've been reading about this:

http://en.wikipedia.org/wiki/Setcontext

是否可以转储该结构的内容,并以某种方式强制malloc分配相同的内存区域?

Is it possible to dump the contents of the struct, and somehow force malloc to allocate the same memory regions?

推荐答案

从技术上讲是可行的,但是它也需要保存所有系统分配的资源状态-例如文件描述符,然后再还原它们.因此,这是一项艰巨的任务.

Technically it is possible, but it would require saving all the system-allocated resources state too - like file descriptors for example and then restoring them. So it's a challenging task.

实现所需目标的最简单方法是使用VMWare等虚拟机.暂停时,实际上可以保存整个计算机状态以及所有正在运行的程序.

The easiest way to achieve what you want is to use a virtual machine like VMWare. When you pause it you actually save the whole machine state together with all programs running.

这篇关于是否保存进程的内存以供以后使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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