- In the image below, is the green area not being used and is the memory area that the Go application only has?
- Why do Go keep the memory in the green area without freeing it right away?
- Is that area also included in the memory usage?
Heap shows memory allocations during the execution of your program. The red area is the memory(heap) used by your program. And the green area is the memory freed by the garbage collector(GC). The red area under the green area is the heap being used after the GC execution. If you zoom the area where heap usage is reduced, you can see how much memory the GC was able to release. And of course, the green area can be reused by your program(and can be more based on the RAM allocated to your program)
Answered By – Pratheesh M
Answer Checked By – Pedro (GoLangFix Volunteer)