FS#13728 - [initscripts] minilogd.c always eat memory on buflines>=MAX_BUF_LINES
Attached to Project:
Arch Linux
Opened by Gerardo Exequiel Pozzi (djgera) - Tuesday, 10 March 2009, 01:41 GMT
Last edited by Aaron Griffin (phrakture) - Friday, 12 June 2009, 15:45 GMT
Opened by Gerardo Exequiel Pozzi (djgera) - Tuesday, 10 March 2009, 01:41 GMT
Last edited by Aaron Griffin (phrakture) - Friday, 12 June 2009, 15:45 GMT
|
Details
Description: minilogd always eat memory when
buflines>=MAX_BUF_LINES. This is because of the line for
reserving memory for "*message" in calloc() @ runDaemon()
Then from my point of view (if no syslogd startup in the system) maybe these solutions: 1) close the /dev/log, then no more conections are accepted, but always check if the /dev/log "times" have been changed, to dump buffer to it. 2) Accept conections like now, but don't reserve memory with calloc() every time for "*message" buffer, so overwrite the message. (only need one calloc() when buflines>=MAX_BUF_LINES, and free() on exit). 3) Another more convenient approach. For the option the programs thta uses logger functions: 1) see the system as if no logger daemon was loaded (calls to logger funtions returns errors) 2) will log errors, but will be silently ignored. 3) ... Additional info: initscripts-2009-NN Without starting syslog-ng. NOTE: I don't create a patch for this, leaving open the possibility to implement more you see fit. |
This task depends upon
Closed by Aaron Griffin (phrakture)
Friday, 12 June 2009, 15:45 GMT
Reason for closing: Implemented
Additional comments about closing: In git
Friday, 12 June 2009, 15:45 GMT
Reason for closing: Implemented
Additional comments about closing: In git
The idea is:
Log messages are always received/acepted, but these are ignored when MAX_BUF_LINES is reached then: calls only one more time to calloc(), so don't lacks memory and the process don't grow. These messages are "ignored" and overwrited in each new log entry.
0002-Fix-warning-when-compili... (0.8 KiB)