S
Scott Brady Drummonds
Hi, everyone,
A coworker and I have been pondering a memory allocation problem that we're
having with a very large process. Our joint research has led us to the
conclusion that we may have to replace the STL allocator. But, before I
even attempt something like this, I wanted to ask some questions to this
group:
1) We read online that STL caches allocated memory so that containers and
their contents that are freed at one point in the program are available to
other STL containers, but not to code that would attempt to get memory from
the free store. Is this correct?
2) It appears that the same is the case with the "normal" memory allocator
(which we've been calling the 'glibc' memory allocator; is this a misnomer).
Memory that has been released from the program with the 'delete' statement
is available to other calls to 'new' but not to memory being allocated by by
the STL memory allocator. Is this right?
The conclusion here seems to be that a program that allocates large chunks
of memory using both the STL allocator and glibc allocator is doomed to be
quite memory-inefficient. If avoiding the usage of both of these allocators
is impossible in our program, what hope do we have?
Thanks,
Scott
A coworker and I have been pondering a memory allocation problem that we're
having with a very large process. Our joint research has led us to the
conclusion that we may have to replace the STL allocator. But, before I
even attempt something like this, I wanted to ask some questions to this
group:
1) We read online that STL caches allocated memory so that containers and
their contents that are freed at one point in the program are available to
other STL containers, but not to code that would attempt to get memory from
the free store. Is this correct?
2) It appears that the same is the case with the "normal" memory allocator
(which we've been calling the 'glibc' memory allocator; is this a misnomer).
Memory that has been released from the program with the 'delete' statement
is available to other calls to 'new' but not to memory being allocated by by
the STL memory allocator. Is this right?
The conclusion here seems to be that a program that allocates large chunks
of memory using both the STL allocator and glibc allocator is doomed to be
quite memory-inefficient. If avoiding the usage of both of these allocators
is impossible in our program, what hope do we have?
Thanks,
Scott