[CRIU] Avoid dumping specific VMA ranges

Pavel Emelyanov xemul at virtuozzo.com
Wed Nov 30 03:17:40 PST 2016


On 11/30/2016 12:47 PM, Rodrigo Bruno wrote:
> Hi all,
> 
> I am using CRIU to checkpoint JVMs with heaps > 10GB.
> 
> I want to reduce the size of the checkpoint and I know that there are memory ranges that
> although being allocated and touched by the JVM, represent garbage and could be discarted

Heh... This is something I thought of long ago. The idea by that time was
that we could ship a library that applications can link with, and, when
criu dumps them, it can detect the library is there and call some code from
victim task. So that application can do some preparatory work before being
checkpointed. But this would require patching JVM :\

> when dumping the JVM (don't worry, I can ensure that the JVM is stopped while running this operation).
> 
> Q1. Does CRIU support this?

Nope :)

> Q2. Without changing CRIU, is there any way to achieve this? Could I change a page table
> entry to force a page with garbage to be mapped to the zero page?

Yes and no. There are no standard knobs for this, but (!) we have announced
compel recently. With it you can cook a parasite code that would call
MADVISE_DONTNEED on the desired ranges thus punching the holes in memory.

-- Pavel



More information about the CRIU mailing list