|
From: Christoph B. <bar...@or...> - 2007-07-14 13:50:01
|
Am Samstag, 14. Juli 2007 schrieb Nicholas Nethercote: > On Sat, 14 Jul 2007, Christoph Bartoschek wrote: > > Is it possible to give memory back to the system that is allocated in the > > arena manager? > > I don't think so. > > > Currently all allocations are done using am_sbrk_anon_float_valgrind or > > am_sbrk_anon_float_client. For the later one could use > > am_mmap_anon_float_client and release memory with am_munmap_client. But > > there is no am_munmap_valgrind that releases memory from > > am_mmap_anon_float_valgrind. Is there a reason for this? > > I think it's not uncommon for heap allocators to not return memory, but I > could be wrong. You are right, but it is also common to mmap really big chunks of memory and return it back via munmap. Only small chunks, especially ones allocated via sbrk, are kept forever. > > BTW, what is the difference between the client and valgrind versions of > > this functions? I do not get this from the header. > > Do you mean VG_(malloc) vs. VG_(arena_malloc), for example? The former > just calls VG_(arena_malloc) with the arena set to VG_AR_TOOL. See > coregrind/m_mallocfree.c. I mean the difference between (VG)_am_mmap_anon_float_client and (VG)_am_mmap_anon_float_valgrind. Christoph |