Search code examples
c++linuxlinux-mintcoredump

reduce core dump size on linux


What are the best methods to reduce a core dump's size?

My problem is that I have very little space dedicated to the purpose on my Linux Mint. I have around 200 MB which is far not enough for my program to generate a decent dump. I have tried configuring the coredump filter, but only the anonymous private mappings dump made any significant change in the size, but it also made my dump unreadable. I also tried to limit the size with ulimit, but the only result was that dump was truncated every single time.

My question is that what is the best way to control the core dump's size? Is there any way to keep only maybe the top 10-15 frames of a dump? Also what is the use of setting the size limit with ulimit, if it only generates useless core files?


Solution

  • Consider using Breakpad: https://code.google.com/p/google-breakpad/ https://code.google.com/p/google-breakpad/wiki/GettingStartedWithBreakpad :

    Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact "minidump" files, send them back to your server, and produce C and C++ stack traces from these minidumps. Breakpad can also write minidumps on request for programs that have not crashed.