News for hackers. Stuff that matters.
Re:Major standard library changes in Go 1.20 by _old_dude_ on Tuesday January 17, 2023 @04:58AM (#34410827)
yes, Java/C# GCs (Android included) and Go GC are very different beasts.

Go GC does not move objects in memory (mark and sweep) while other GCs (mark and compact) do, to avoid heap fragmentation and better throughput (see generational GCs).

One issue with mark and compact GCs is that you can not move the array of bytes during a system call. A ByteBuffer/Memory object, is an object that allocates its byte arrays using malloc, outside of the heap, so the bytes are not moved by the GC.

There are no comments on this comment yet.