Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Maps and Memory Leaks in Go. Parent comment
It is not.
Let me show you a memory leak in the memory safe language, rust:
let vec: Vec<u8> = Vec::with_capacity(1024); std::mem::forget(vec);
_ = time.Tick(1 * time.Second)
You can also, if you want to leak memory in go, set the environment variable GOGC=off, and there you go, instant memory leak.
Practically any language, memory safe or otherwise, will let you create a memory leak.
There are no comments on this comment yet.
It is not.
Let me show you a memory leak in the memory safe language, rust:
Let me show you a memory leak in the memory safe language, go: See the docs for time.Tick in the stdlib, which documents that calling it is a memory leak: https://pkg.go.dev/[email protected]#TickYou can also, if you want to leak memory in go, set the environment variable GOGC=off, and there you go, instant memory leak.
Practically any language, memory safe or otherwise, will let you create a memory leak.