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

I think the GC in Go only runs when allocations have been made. No allocations = no GC.


Yes, but that's only true if you get down to zero allocations. Memory pools reduce allocations, but you cannot get down to zero allocations--even if you somehow managed to convert every allocation site into a memory pool (which basically means not using the standard library), you'd still have to allocate the pool (unless it's stored in static memory, but then your maximum number of allocations is fixed).

The only code I've seen that actually had zero allocations in a GC'd language is actually Emscripten-generated code in JS, which is of course not actually JS but C.




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

Search: