A core dump is a snapshot of the memory occupied by a process plus additional debugging information. Core files are typically generated when a process terminates unexpectedly. This tech-recipe describes how to generate a core file manually from a running process.
To generate a core file named ‘core’ in the current working directory for a process with the id of 345, use the following:
If you want to control the name of the core dump file, use the -o option with a filename or path and filename, such as core.test or /tmp/core.1
gcore -o /tmp/core.1 345