This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Memory NEVER freed!
- From: Stefan Olsson <stefan at noname4us dot com>
- To: Jean-Eric Cuendet <Jean-Eric dot Cuendet at linkvest dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 08 Aug 2002 14:13:10 +0200
- Subject: Re: Memory NEVER freed!
- Organization: Noname4us
- References: <61FEFD6522F0F142B36E3F6CE511A4F01D37BB@hermes.linkvest.com>
Which OS and GCC version are we talking about?
For instance the Linux malloc() implementation does not return allocated
memory to the OS (unless the size is larger than mallopt M_MAP_MAX in
which case the memory is actually mmap'ed and can thus be returned to OS).
Brgds
/Stefan
Jean-Eric Cuendet wrote:
Hi,
I have a problem. One of my program allocate a LOT of small pieces of memory with new/delete.
When freed, the RSS of my prog doesnt change!
I *THINK* that the memory is freed since if I alloc again the same space, the RSS doesnt change. But the RSS *NEVER* come back to the level it was before the allocation.
Ex:
Begin: RSS=10Mb
Alloc 50Mb => RSS=60Mb
Free 30MB=>RSS=60Mb
Free remaining 20Mb=>RSS=60Mb
!!!!
Alloc 30Mb=>RSS=60Mb
Alloc 30Mb=>RSS=70Mb
Free 60Mb=>RSS=70Mb
Why?
Is there a way to tell my prog to release the not used pages?
Is there a compact memory method?
Thanks for any help.
-jec
PS: Im not in the list so please CC me. Thanks.
--
An expert problem solver must be endowed with two incompatible qualities,
a restless imagination and a patient pertinacity.