in ,

A Practical Guide to Memory Leaks in Node.js, Hacker News

A Practical Guide to Memory Leaks in Node.js, Hacker News

Introduction

Memory leaks are like parasites of an application, they creep up into your systems unnoticed and don’t cause any harm initially, but once leaks are strong enough they can cause catastrophic problems to your application such as high latencies and crashes. In this article we will look at what are memory leaks, how javascript manages memory, how to identify leaks in a real world scenario and eventually how to fix them.

Memory leaks can be broadly defined as a chunk of memory which is no longer required by your application but is not available to your OS for further use. In other words a block of memory which is being taken up your application with no intention of using it in future.

Memory Management

Memory management is a way of assigning memory from your machine memory to your application and then releasing that memory back to your machine when no longer in use. There are multiple ways of memory management and it depends on the programming language you are using. Below are a few ways of memory management:

Manual memory management : In this paradigm of memory management, the programmer is responsible for both assigning and then releasing the memory. The language by default wont provide any automated tools to do so for you. While it gives you extreme flexibility, its an added overhead too. C and C use this approach to manage memory and provide methods like malloc and free to coordinate with machine memory.

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

California once had mobile hospitals and a ventilator stockpile. But it dismantled them, Hacker News

California once had mobile hospitals and a ventilator stockpile. But it dismantled them, Hacker News

[FREE]Angular 9 Masterclass with TypeScript, Firebase, & Material (16Hrs)