Alex Gorbunov

The Lord of the Memory: The Return of the Leak

Every ten seconds, an application crept closer to crashing. Discover the story of two subtle memory leaks and the debugging quest to vanquish them for good.

The Lord of the Memory: The Return of the Leak
#1about 1 minute

Understanding the computer memory hierarchy

The memory hierarchy from CPU registers and cache to main memory is the foundation for understanding how applications store and access data.

#2about 6 minutes

How the JavaScript engine allocates memory

The JavaScript engine compiles code into an abstract syntax tree and bytecode, then allocates memory for variables on the heap, which is managed in structures like arenas and zones.

#3about 3 minutes

How garbage collection prevents memory leaks

The garbage collector automatically frees memory by tracking object references, and an object is only collected once it is no longer referenced by any part of the application.

#4about 2 minutes

Identifying common JavaScript memory leak patterns

Four common memory leak patterns in JavaScript include unterminated closures, leaky timers, detached DOM nodes with active listeners, and unbounded global caches.

#5about 2 minutes

Using developer tools to detect memory leaks

A variety of tools, including Chrome DevTools Memory and Performance tabs, framework-specific dev tools, and system monitors like htop, can help diagnose memory consumption issues.

#6about 1 minute

Case study: Optimizing frequent data polling

The first step in fixing the application's memory leak was to prevent unnecessary re-renders by comparing incoming data with existing data before updating the UI.

#7about 2 minutes

Case study: Debugging leaks in third-party components

Two separate memory leaks were traced to third-party UI libraries where component instances and their templates were not being properly destroyed, leading to cumulative memory growth.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles

From learning to earning

Jobs that call for the skills explored in this talk.