Memory Leaks

Examples of Memory Leaks
3 Topics

Articles

Real-world examples of common causes of memory leaks in JavaScript

If you write front-end or Node.js code long enough, you’ll eventually run into a page or service that slows to a crawl, eats RAM, and finally dies. That’s your sign to go hunting for memory leaks. In this guide, we’ll walk through real, practical **examples of common causes of memory leaks in JavaScript**, not just theory. We’ll look at how they show up in modern apps, how to recognize them in Chrome DevTools or Node.js, and what to change in your code so they don’t come back. These examples include everything from forgotten event listeners in React, to runaway caches in Node microservices, to subtle closures that keep old DOM trees alive. You’ll see why these leaks are so easy to introduce, especially in single-page apps that never reload. By the end, you’ll have a mental checklist of the best examples to watch for the next time your heap graph looks like a staircase instead of a wave.

Read article

Real‑world examples of memory leaks in C++ and how to fix them

If you write C++ long enough, you will create a memory leak. The fastest way to learn how to avoid them is to study real examples of memory leaks in C++. In this guide, we’ll walk through practical examples of examples of memory leaks in C++, show how they happen, and then clean them up using modern C++ techniques. Instead of hand‑wavy theory, we’ll look at concrete scenarios: leaks in exception paths, containers, singletons, callbacks, thread code, and more. These examples of mistakes come straight from patterns that still show up in production systems in 2024, especially in older codebases that haven’t fully adopted RAII and smart pointers. By the end, you’ll be able to spot a suspicious `new` from a mile away, understand when tools like Valgrind and AddressSanitizer are worth running, and recognize the best examples of safe patterns that avoid leaks entirely. If you’re maintaining legacy C++ or performance‑critical systems, these examples include exactly the failure modes you need to have in the back of your mind.

Read article

Real-world examples of memory leaks in web browser extensions: 3 examples that keep happening in 2025

If your browser starts eating RAM like it’s an all-you-can-eat buffet every time you install a new add-on, you’re not imagining it. Many of the worst slowdowns come from poorly written extensions, and the best way to spot them is to look at real examples of memory leaks in web browser extensions. In this guide, we’ll walk through 3 core patterns that repeatedly cause leaks, then expand into several more real examples that show how these bugs appear in everyday extensions. These examples of memory leaks in web browser extensions aren’t theoretical. They map directly to issues seen in popular ad blockers, password managers, tab managers, and content scripts across Chrome, Firefox, Edge, and other Chromium-based browsers. By the end, you’ll recognize the warning signs, understand why your browser sits at 4 GB of RAM with only a few tabs open, and know which coding habits quietly keep extension memory under control.

Read article