Solution for linux core diagnostic files occupying storage space

linux core 诊断文件占用存储空间的解决方案

Background introduction

When the program exits abnormally under Linux, the kernel will generate a core file (a memory image, plus debugging information) in the current working directory. Using gdb to view the core file can indicate the file and line number of the code that caused the program to fail.

an examination

Use this command to check the current settings

 ulimit -c

If the result is 0, it means that this function is turned off and the core file will not be generated.

If the result is unlimited, it means unlimited generation.


There is nothing else to say, just look at the reference materials for yourself


Use this command to adjust the quota (the unit of filesize is kbyte)

 ulimit -c filesize

You can also extreme infinite or closed

 ulimit -c 0
 ulimit -c unlimited


For example, I encountered a lot of garbage taking up storage space



linux: core file generation and debugging

This article is reprinted from
This site is for inclusion only, and the copyright belongs to the original author.