2011/9/7 Benny Prijono <bennylp at teluu.com>: >> Here is a simple example. I have a hashtable which is instantiated >> from the very beginning of my program execution and which lasts until >> it ends. Many objects are added and then removed in this table. I need >> a pool to insert elements in this table, but I cannot use a global >> pool for all of them because it could lead to memory exhaustion. The >> solution I have found is to associate a pool to each entry in the >> table. So memory is freed when expired elements are removed from the >> table and destroyed. Does it sound good? What's your solution? >> > > That's exactly what we do. > >> More generally, how do you handle the problem of memory management >> when there can be unlimited successive allocations of objects with a >> long lifetime, like in the pjlib's balanced tree or hashtable ? > > Didn't you answer this yourself above? I did. But I still feared to miss something. So thanks a lot for your answer. -- David