That's what cgroups is for. You make sure that things OOM early enough that rest of the system has enough memory to handle it gracefully.
As to kernel swapping the OOMed program back to ram from swap when you read the dump file, with cgroups setup retaining enough memory for the rest of the system (and kernel) while the OOMing container group is frozen that shouldn't be a problem either.