httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Parsers test eats all the memory
Date Thu, 13 Jan 2005 02:27:43 GMT
Getting advanced a bit. I wrote this test program:

#include <apr.h>
#include <apr_errno.h>
#include <apr_pools.h>
#include <apr_buckets.h>
#include <stdio.h>

#define LOOPA 300
#define LOOPB 300

int main(void) {
     apr_pool_t *pool;
     apr_size_t i, j;

     if (apr_pool_initialize() != APR_SUCCESS) {
         printf("Can't initialise pools!");
         return 1;
     }

     if (apr_pool_create_ex(&pool, NULL, NULL, NULL) != APR_SUCCESS) {
         printf("Can't create pool!");
         return 1;
     }

     for (j = 0; j <= LOOPA; ++j) {
         fprintf(stderr, "LEN %d\n", j);

         for (i = 0; i <= LOOPB; ++i) {
             apr_bucket_brigade *bb;
             apr_pool_t *sp;

             if (apr_pool_create(&sp, NULL) != APR_SUCCESS) {
                 printf("Can't create new pool!");
                 return 1;
             }

             bb = apr_brigade_create(sp, apr_bucket_alloc_create(sp));
             apr_brigade_destroy(bb);

             apr_pool_destroy(sp);
         }
     }

     apr_pool_destroy(pool);

     apr_pool_terminate();

     apr_terminate();

     exit(0);

}

If compiled as:

gcc -g -O0 -o pool aprpool.c -lapr-0 -lrt -lm -lcrypt -lnsl -lpthread -ldl 
-laprutil-0 -lgdbm -ldb-4.0 -lexpat -Wl,--rpath 
-I/home/stas/httpd/prefork/include -L/home/stas/httpd/prefork/lib

everything is fine. if I do:

   s{-L/home/stas/httpd/prefork/lib}
    {-Wl,/home/stas/httpd/prefork/lib}

I get this huge leak (which is how apreq2 test suite builds).



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message