The Silent Drive Fillers
When an application crashes on a Linux system, the operating system can generate a “core dump”—a massive file containing the exact state of the computer’s memory at the exact moment of the crash. Ubuntu utilizes a system called Apport to manage these crashes. While these core dumps are invaluable to software developers trying to fix complex bugs, they are completely useless to the average user. Worse, if a background service is quietly failing and restarting in a loop, Ubuntu can automatically generate gigabytes of these core dump files, silently filling up your entire hard drive and eventually crashing the whole system due to lack of space.
Halting the Core Dumps
To protect your hard drive space and stop Ubuntu from automatically generating core dumps when applications crash, you must restrict the file size limits at the system level.
You need to modify the security limits configuration file via the terminal. Open your terminal by pressing Ctrl+Alt+T. Type sudo nano /etc/security/limits.conf and press Enter (provide your password). Scroll to the very bottom of this file. You need to add a rule that sets the maximum size of a core file to zero bytes. Add the following line exactly: * hard core 0. (The asterisk means this applies to all users). Press Ctrl+O then Enter to save, and Ctrl+X to exit. For this system-wide limit to take full effect across all services, you should reboot your computer. Ubuntu will no longer write these massive files to your disk.