Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Virtually all GC languages have this option, but it is rarely better overall than the default algorithm for deciding when to do it.

The biggest problem with GC is that it is often global, and a simple call to invoke the global GC doesn't usually help from a local scope. There are some arena-based allocators (I believe OCaml's GC uses this strategy) where this may be more beneficial.

But the question always looms: if there is not enough memory to serve an allocation invoked from a hot loop, what should the program do?

Note also that in advanced GCs, such as .NET or the JVM, a hot loop that doesn't allocate will often not need to be stopped by the GC at all. There are even GCs (all proprietary as far as I know) that guarantee a fixed pause time, so that they can be used in real-time workloads - Azul's JVM GC has this option for example.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: