Skip to content

Instantly share code, notes, and snippets.

@WagnerMoreira
Last active May 26, 2020 15:04
Show Gist options
  • Save WagnerMoreira/fbd4fd940839a98855fa165afecadd39 to your computer and use it in GitHub Desktop.
Save WagnerMoreira/fbd4fd940839a98855fa165afecadd39 to your computer and use it in GitHub Desktop.
Profiling a server side rendered React APP to look for memory leaks
node --inspect --trace_gc src/server

In another tab

ab -r -k -n 1000 -c 200 -H "user-agent:Googlebot/2.1 (+http://www.googlebot.com/bot.html)" http://localhost:8000/programs

This will spin up a node app in inspect mode and then we use the ab tool to fire a number of requests to a particular page that we think might have a memory leak and watch the logs on the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment