I use rotatelogs utility which comes with apache 2.0.55 to maintain various logs. For unknown reasons, the process which manages access_log uses lots of memory. The following is a snapshot of "top" results. In the production system, it uses 2.5 G out of total 4 G memory. I suspect there are memory leak in this program. Please investigate. Thanks. last pid: 28090; load averages: 0.01, 0.11, 0.15 17:01:08 71 processes: 70 sleeping, 1 on cpu CPU states: 99.3% idle, 0.0% user, 0.7% kernel, 0.0% iowait, 0.0% swap Memory: 2048M real, 1340M free, 410M swap in use, 13G swap free PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND 29404 root 69 0 10 136M 79M sleep 33:05 0.00% java 15073 root 4 58 0 37M 35M sleep 0:23 0.00% rotatelogs 227 root 20 58 0 9960K 4216K sleep 0:05 0.00% syslogd 13564 root 3 59 0 6832K 4136K sleep 0:00 0.00% httpd
It looks like the memory use of rotatelogs will be proportional to the number of times it has re-opened the log file; it needs to be using subpools and clearing them etc to have constant memory use. (pools are grrrrreat!)
Created attachment 21431 [details] workaround against trunk make a pool for logfile and clear it in each apr_file_open. I made this patch in a short glance so there might be better solutions.
IMHO this would SEGFAULT if we fail to open a new logfile and have to reuse the old one. So I committed a slightly modified version of your patch to trunk as r615901 (http://svn.apache.org/viewvc?rev=615901&view=rev). Given the typical frequency of logfile reopenings I guess we can afford the apr_pool_create / apr_pool_destroy overhead.
(In reply to comment #3) > IMHO this would SEGFAULT if we fail to open a new logfile Exactly. My patch was very random. Thanks for review.
How can I get this modified rotatelogs.c .I downloaded new snapshot from apache.org for httpd it did not contained this change. Plz Comment Thanks A
(In reply to comment #5) > How can I get this modified rotatelogs.c .I downloaded new snapshot from > apache.org for httpd it did not contained this change. > Plz Comment > Thanks > A > sorry got the file. Thanks A
Fixed since 2.2.9.
*** Bug 44783 has been marked as a duplicate of this bug. ***