Is it safe to assume that they have to deal with fragmentation or does Go solve that another way?
Is it safe to assume that they have to deal with fragmentation or does Go solve that another way?
"Heap fragmentation is not normally a concern with the current Go runtime. The heap is implemented to that large pages are divided up into blocks that are all the same size. This means that the usual definition of fragmentation--a small block prevents coalescing of large blocks--can not occur. "
1. https://groups.google.com/d/msg/golang-nuts/Ahk-HunIqgs/1sOi...
I'm used to systems that vary from 8-512mb of total system ram with no virtual memory. Techniques that work well on the desktop/server explode spectacularly when brought to our platforms.
I don't know much about the internals of Java, but I know that Go will stack allocate any kind of object if the compiler can prove it doesn't escape, and that in Go lots of things (not just native types) are passed by value on the stack instead of by reference to a heap value.
I guess it's just a different class of problems that I'm used to dealing with. Fragmentation is something I've seen many times and it usually likes to rear it's head at the worst possible moment.
Golang supports value types for objects, so arrays (or something higher level like sync.Pool) work great for doing arena allocation.
This is also the case in HotSpot.