[CRIU] Avoid dumping specific VMA ranges

Raghavendra Prabhu me at rdprabhu.com
Sun Dec 4 09:20:09 PST 2016


Hi,

I have seen similar problem manifesting in the form such as
https://bugs.launchpad.net/percona-server/+bug/1092645 wherein people
don't want large memory pools in their coredumps. In this case, they
mark it as MADV_DONTDUMP.  Is it good to  assume that whatever is not
required in the coredump is not good for checkpoint images either.  If
not MADV_DONTDUMP, /proc/$pid/coredump_filter is used.

So, wondering if something like
https://gist.github.com/ronin13/59c6ffab786db7ef9e54db4fb29b4992 would
be useful here.


On Wed, Nov 30, 2016 at 11:17 AM, Pavel Emelyanov <xemul at virtuozzo.com> wrote:
> 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
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list