Skip to content

Instantly share code, notes, and snippets.

View andrewb's full-sized avatar

Andrew Berry andrewb

  • Andrew Berry
  • Portland, ME, USA
View GitHub Profile
@andrewb
andrewb / memory-leak-debug.md
Created March 25, 2019 12:05
Quick guide to debugging Node memory leaks

Quick guide to debugging Node.js memory leaks

The basics

Run the app locally using the --inspect switch. For example node --inspect index.js. Note: if you are debugging a complex Next.js app (or similar) you need to use a production build, otherwise you’ll get stuck on "Building dominator tree…" (see this issue for some info). To inspect Oxygen, run yarn build and NODE_ENV=production node --inspect server.js

Open DevTools for Node. You can do this by visiting chrome://inspect/#devices and looking for your app under "Remote Target".

Screen Shot 2019-03-21 at 6 58 12 AM

import curry from 'lodash.curry';
/*
CURRYING
What is a curried function?
It's a function that takes multiple parameters,
one at a time.
// Hello! Let's try something different...
// *************************
// *** Functional Mixins ***
// *************************
// PART 1 - Classes and Mixins
// Before we get to functional mixins, let's take a look at mixins, and before we get to mixins let's
// look at classes.