You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by ra...@madhaus.utcs.utoronto.ca on 1996/05/08 17:22:57 UTC

Memory Pool Management Question

I have a module which in some instances can eat up a lot of memory.
I use the palloc() and pstrdup() routines from the Apache API to fetch
this memory from the session memory pool.  I don't free this memory
when I am done with it, instead relying on Apache to do something
intelligent with it when I am done.

In skimming the alloc.c code, it doesn't look to me that this memory is
ever returned to the system.  It is marked as having been freed and is
thus available to ensuing sessions.  My module is a script language
parser which for certain scripts can eat up many megabytes.  I have one
script which easily takes 60 megabytes to chew away on mSQL database
queries.  This 60 meg script doesn't get run very often.  Perhaps once
every 500 queries. However, eventually all my httpd processes will have
run this large script once and the result is that they have all allocated
60 megabytes.  

Suggestions?  Should I not be using the session pool memory for this?
Or, could there be some way through the API to force this memory to
be returned to the system?  Or, am I completely off-base in my understanding
of how this works?

-Rasmus