[Go] Stack and Heap, Garbage Collections

Stack is dedicated to function

  • Local variables are store in stack
  • Deallocated after function completes

Heap is persisten

Carbage Collections

  • Go is a compiled language which enables garbage collection
  • Implementation is fast
  • Compiler determines stack vs heap
  • Garbage collection in the background
posted @ 2022-09-07 16:17  Zhentiw  阅读(9)  评论(0编辑  收藏  举报