[CRIU] [Question] CRIU memory dumps and CoW
Shubham Chaudhary
shubhamchaudhary1996 at gmail.com
Fri May 1 17:10:18 MSK 2020
Hello,
I'm trying to dump a set of tasks which share a lot of read only data but
the dump size goes up in proportion to the number of child processes. I've
read the page on Copy on Write optimization in CRIU (
https://criu.org/Copy-on-write_memory).
For example, if I try to dump the processes running this simple C code:
int main () {
int *mem = (int *) malloc(sizeof(int) * 1024 * 1024 * 1024);
for (int i = 0; i < 1024 * 1024 * 1024; i ++) mem[i] = i;
fork();
while (1) {}
return 0;
}
The size of the images is 8G, but the 4G segment of VM is read only and
thus need not be duplicated. Is it so that CRIU dumps the entire process
space but marks the memory segments as CoW only upon restore? In that case,
would it be possible for CRIU to store only the memory segments that have
changed to decrease dump size? I would be happy to take up this line of
work if anyone can point me in the right direction.
Thanks in advance for the help!
Shubham Chaudhary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20200501/9a8f5739/attachment.html>
More information about the CRIU
mailing list