digitalmars.D.learn - GC.collect vs. GC.minimize
- Brother Bill (2/2) Sep 23 Is it the case that GC.collect forces a typical GC cycle, and
- =?UTF-8?Q?Ali_=C3=87ehreli?= (12/14) Sep 24 GC.collect is already "full collection" as quoted from here:
- Brother Bill (4/8) Sep 28 Does D do 'Generational' GC, or is it simply if there isn't
Is it the case that GC.collect forces a typical GC cycle, and GC.minimize does a full mark and sweep?
Sep 23
On 9/23/25 7:33 AM, Brother Bill wrote:Is it the case that GC.collect forces a typical GC cycle, and GC.minimize does a full mark and sweep?GC.collect is already "full collection" as quoted from here: https://dlang.org/library/core/memory/gc.collect.html GC.minimize is a request to GC to give the underlying unused memory back to the OS. To me, it's useful in rare cases where an application does lots of allocations early on and then gets into a steady state of low memory usage. The program can request the GC before getting to that steady state to give the memory back to the OS, which the GC might still be holding on in hopes of reusing it in the future. So, a GC.minimize translation: "I know I will not need memory close to what I've used so far; give all your free blocks back to the OS." Ali
Sep 24
On Wednesday, 24 September 2025 at 22:55:57 UTC, Ali Çehreli wrote:So, a GC.minimize translation: "I know I will not need memory close to what I've used so far; give all your free blocks back to the OS." AliDoes D do 'Generational' GC, or is it simply if there isn't enough memory, to do a 'collect'?
Sep 28








Brother Bill <brotherbill mail.com>