www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thu Nguyen <...@ulogon.com>
Subject apache-api/5812: apache server does not release memory (pool) automatically or when call ap_destroy_pool()
Date Sat, 26 Feb 2000 00:14:38 GMT

>Number:         5812
>Category:       apache-api
>Synopsis:       apache server does not release memory (pool) automatically or when call
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Feb 25 16:20:00 PST 2000
>Originator:     tnn@ulogon.com
>Release:        1.3.9
Windows 98
I'm writing a module to replace my CGI scripts. Everything goes very smooth, except that I
found out:
- in every call to my module handler the system allocated memory will not be free.
- ex: I'm using libapreq in my code to receive a request, and upload file. every upload file,
my system have to allocate a chunk of memory and never free it.
- I tried to use subpool ap_make_sub_pool() out of r->pool and destroy it as soon as I
finish. I call ap_bytes_in_pool() and see the same size as before and after ap_destroy_pool
- I digged into alloc.c and found the defined tag: #define ALLOC_USE_MALLOC. wow, after compile
the apache with this define the memory is free automatically. I don't even have to destroy

- why is that?

- in my module, some handler will fail with ALLOC_USE_MALLOC

I appologize if I bring up such a stupid problem. If so, please point out for what I should
do to free up the memory when using pool

Thu Nguyen
-create a module with handler to open a file, save everything in the buffer created by ap_pcalloc()
- monitor your system allocated memory and see it goes up and never back down.
ALLOC_USE_MALLOC seem to do the trick but cause other problems...
wells, is there others?
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message