-
Is it possible to go off heap (similar to Java), that is manage your own memory in Go (without GC)?
-
If yes, what is the api or the way to do it?
2 Likes
Sure you can. A simple google search gives lots of potential packages with different use cases:
- https://github.com/shoenig/offheap
- https://github.com/glycerine/offheap
- https://github.com/VictoriaMetrics/fastcache
- https://godoc.org/golang.org/x/exp/mmap
- https://github.com/edsrzf/mmap-go
The question is more “for what purpose” and “why”?
2 Likes
I’m curious, is it possible to develop a “shim” layer for Go binary to operate as it is? I’m looking from TinyGo perspective to use Go for microcontroller. If those codes can be developed in Go, that would be nice. (Currently they are in embedded C).
EDIT: I would try to avoid hacking Go like TinyGo did to the heap memory part. It’s not easy to master memory mapping theorem.
1 Like
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.