Go memory consumption management

前端 未结 2 1510
陌清茗
陌清茗 2021-02-01 17:41

I am new to Go and trying to figure out how it manages memory consumption.

I have trouble with memory in one of my test projects. I don\'t understand why Go uses more an

2条回答
  •  清酒与你
    2021-02-01 18:02

    To eventually (force) collect unused memory you must call runtime.GC().

    variable = nil may make things unreachable and thus eligible for collection, but it per se doesn't free anything.

提交回复
热议问题