[Issue 3284] snn linked programs never release memory back to the OS

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 19 03:33:13 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=3284

Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #9 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
I think this needs more focus/clarity of what is broken and needs to be fixed.
Is it the C functions or the GC?

Note that we don't use the libc allocators in the GC, we use the OS APIs
directly.

Also worth noting that heap allocators, whether new (GC), malloc (libc), or
HeapAlloc (OS), are all vulnerable to fragmentation. Programs can only release
memory back to the OS if the entire page is free.

It's possible that we no longer release memory to the OS after a GC cycle,
because in many applications any released memory is going to be immediately
requested again. Applications which require memory in bursts are comparatively
rare. I recall that we no longer reserve memory from the OS - though it was a
thing we could do and it aligned with the GC design, it was not useful in any
measurable way, so it was removed.

--


More information about the Digitalmars-d-bugs mailing list