Thursday, December 24, 2009

How to Enable Cores dumps on UNIX systems

# ulimit -c

This command shows if your system can create a core dump. If it returns a 0 you need to run the next command.

# ulimit -c unlimited
This command allows the core files to be generated with an unlimited size. If disk space is a concern you can replace unlimited with the maximum size that is desired for core files. The value is specified in 1 kb increments.

For Example:

# ulimit -c 1024 creates a core file that is up to 1 MB in size
# ulimit -c 1024000 creates a core file that is up to 1 GB in size.


It is defined in /etc/profile as:

ulimit -S -c 0 > /dev/null 2>1


Change it to

ulimit -S -c unlimited > /dev/null 2>1

Core dump location:
-----------------------

By default, core files are created in the working directory of the faulting application.

To override this and specify a new location for the files, enter the following command (as root) replacing "/tmp" with the desired target directory:

# echo "/tmp" > /proc/sys/kernel/core_pattern

1 comments:

  1. sir,
    this is a good info
    :)
    Sandeep

    ReplyDelete