Grokking Operating Systems and Networking for Backend Engineers
Vote

0% completed

​

Garbage Collected Runtimes and the OS

A Go version of a Checkout worker builds 300 MB of order data, drops it, and forces a garbage collection. The runtime now reports 0 MB of heap in use. Five seconds later, the kernel still counts 303 MB of resident memory for the process.

Nothing leaked. The runtime knows that the memory is free, but it has not told the kernel. A dashboard that watches RSS and a dashboard that watches the heap now disagree by 300 MB.

This page explains how the Java, Go, Node.js, and Python runtimes get memory from the kernel and give it back, and why a process can look much larger than its heap.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content