Garbage Management: Java vs Go

SHIVAM SOURAV JHA
Breaking Tech
Published in
4 min readDec 26, 2022

--

Content table for blog

  • Introduction to blog.
  • what is Garbage Collection/Collector?
  • How GC operates.
  • Java’s GC
  • Golang’s GC.
  • Links to resources

Welcome to yet another blog on the internet about Golang, but don’t worry I won’t say pick Golang because it has optimised garbage collection, rather let’s understand what this statement means. Since we call ourselves software developers let’s do the DFS about the infamous Garbage Collection in Golang.

can this beast on Channel steroid beat the garbage?

What is Garbage Collection/Collector?

Assume you write code; to implement it, a specific procedure is called, and it is given a specific amount of RAM. What happens next? The function or code that has completed its task has reserved memory in RAM until it is deleted, resulting in a memory leak/memory overflow.

But, surely, we can free the memory? Yes, we can, and we can make mistakes and blow things off in the process (“the intern brought down the prod again”). This was an issue with boomers like C and C++, but GenZ Go and evergreen Java made their garbage collector automatic. As a result, users face less of a burden.
This is referred to as Garbage Collector (GC).

--

--

Breaking Tech
Breaking Tech

Published in Breaking Tech

We try to talk about tech, breaking into the details and experimenting new things.

Responses (3)