Operating System - HP-UX
1830944 Members
2207 Online
110017 Solutions
New Discussion

application core file size

 
SOLVED
Go to solution
Kurt Renner
Frequent Advisor

application core file size

We have an application that generates a core file frequently, and fills up the filesystem it is run from. I know the correct answer is to fix the problem that causes it to dump a core image... and we are working on that, but in the meantime, we would like to prevent the filesystem full condition because it is unnecessarily reported by the SAP system running thereon.

Is there a way to determine the maximum size a core image could become. I realize they will not be the same size all the time, but was thinking that the kernel parms maxssiz, maxdsiz, and maxtsiz would be likely values to have some effect on the size to expect. Anyone have any insight into this?
Do it right the first time and you will be ahead in the long run.
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: application core file size

In theory, the maximum would be the sum of those three parameters plus some overhead for headers and kernel data; in practice, it would be less. You could probably better do what you want by making a ulimit -c call in the parent shell of this process to directly limit the size of the corefile to zero if you like.
If it ain't broke, I can fix that.
Hai Nguyen_1
Honored Contributor

Re: application core file size

Assuming that the app is run in /sbin/sh or /bin/sh (which is posix shell). You can set this in user's .profile or set at the command line before starting the app.
# ulimit -c 2048

The above limits the core size to 1Mb. You can adjust the above number, which means 2048 512-byte blocks.

Keeping mind that this will help you limit the size of the core file. However, you may not be able to debug the core files.

Hai
Luc Bussieres_1
Trusted Contributor

Re: application core file size

Kurt,

the size of the core file depend on the memory used by the process. If you don't use that core file to debug that application, you could start your application in a shell where you would have change the coredump limit (by default that value is 2 Gig).
An easy way to do this is to create a small shell script to start you application (I will use xterm in my example):

#!/bin/sh
ulimit -c 2048 # set coredump size to 1 Meg 2048x512 Bytes
xterm



Luc

Tom Maloy
Respected Contributor

Re: application core file size

If this server is dedicated to this application, you can put

ulimit -c 4096

in /etc/profile. Otherwise, wrap the application in a shell that performs the same command.

Tom
Carpe diem!
Kurt Renner
Frequent Advisor

Re: application core file size

Thanks for the responses. I forgot about the ulimit command. That will be a workable solution.
Do it right the first time and you will be ahead in the long run.