httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Harris" <>
Subject Memory leak in 1.3.6
Date Sun, 01 Aug 1999 09:33:59 GMT

I've been tracking down a memory leak for quite a while... I've noticed that
the size of the pconf pool grows by about 50k whenever I gracefully restart my
1k vhost test server. I know that this pool is cleared whenever the server
restarts, but I saw memory size grow whenever I restarted the server.. so I was
quite confused, but after much brain racking and investigation I've tracked
this down.

You see, there are a number of functions which allocate memory in the pconf
pool based on the total_modules integer, such as
httpd_config.c:create_server_config. The problem is that the total_modules
integer is being incorrectly incremented on server reload by the
httpd_config.c:ap_add_module function as triggered by a LoadModule
configuration directive. The comment on the ap_add_module function says that it
should not be called on restart. Basically, whenever the server restarts,
total_modules is incremented (even through there are no new modules) so more
memory is used for the configuration structures than needed. So, whenever you
reload the server, the memory usage grows.

I've not developed a patch for this. I thought it would be better to let you
guys know as soon as possible as the 1.3.7 release is about to be sent out..
and you might want to include a fix for this.

Anyway, I'd have to say this is the most unique memory leak I've seen.

 - David Harris
   Principal Engineer, DRH Internet Services

View raw message