apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damir Dezeljin <program...@nib.si>
Subject Memory management question
Date Mon, 28 Oct 2002 13:05:34 GMT
Hi again.

Remote address patch seams to work fine. 10x to all.

I now have some other questions. I'm envolved in constructing an data
structure (something similar to queue). I will use it during my program.
The lifetime of such a data structure (queue) should grow up to various
hours. I allocate a new node for each data form the memory pool alocated
for the queue. When I don't need a data any more, I just unlink it (lose
the reference to the allocated memory). What will happen with the memory?

Ex.:
What will happen if I allocate in a loop 100.000.000 pointers to int *
from a pool and then simply lose the reference to this pointer. Will this
ocupy 400.000.000 bytes of memory or will some sort of garbage collector
free those data?
If no ... how can I free those data when I don't need them any more. Do I
have to alocate a new pool for eacy leaf and then destroy it? Is it a big
waste of time?

Regards,
Dezo



Mime
View raw message