This will require some work. Currently, the allocation algorithm
treats all mmap-ed memory that is contiguous as a single segment
and a segment can be released all or none. It will take some time
for me to change that. Unfortunately, I don't have much time at
the moment.

Phong

> From [email protected] Sun Mar 31 19:39:26 2013
> Subject: Releasing memory obtained via |mmap()| to the system...
> To: [email protected]
> Cc: Phong Vo <[email protected]>, Glenn Fowler <[email protected]>

> Hi!

> ----

> Are there any plans to implement support for releasing memory obtained
> via |mmap(..., MAP_ANON)| to the system (via |munmap()|) anytime soon
> ?
> The issue I got bug reports about is that if ksh93 allocates very
> large arrays as function-local variable then leaving the function
> doesn't release the memory... even if it's in the two-digit GB range.
> The issue is that this puts the system's VM subsystem under major
> stress... and IMO more stress than allocators which explicitly tell
> the underlying kernel that the memory is temporarily not needed.

> The algorithm I'm looking for should work like this:
> 1. Each time memory is compacted the allocator should issue a
> |madvise(data, s, MADV_DONTNEED)| over the affected data (note that
> |data| must be page aligned and that the backingstore for these pages
> is "released"... which means the next time these pages are accessed
> they may be zero-filled). See
> ttp://lxr.mozilla.org/mozilla-central/source/js/src/gc/Memory.cpp#374
> for an example how this is done.
> 2. If there is excessive (say... 1/128 of the currently mapped memory
> is in use) memory mapped by the libast allocator but not in use by the
> consuming applications some of this unused memory should explicitly be
> |munmap()|'ed.

> ----

> Bye,
> Roland

> --
>   __ .  . __
>  (o.\ \/ /.o) [email protected]
>   \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
>   /O /==\ O\  TEL +49 641 3992797
>  (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to