Node.js Application Troubleshooting Manual - Comprehensive GC Problems and Optimization

Intro

Problems Caused by GC

  • Memory leakage caused by code writing errors
  • Reduced program execution performance

Phenomena and Original Analysis of Problems

  • The heap memory keeps reaching the preset conditions that trigger GC operations
  • The process keeps triggering GC operations
  • The CPU usage of the process is high
  • — trace_gc: When it is enabled, a line of log briefly describes the time, type, heap size changes, and causes of each GC.
  • — trace_gc_verbose: When it is enabled together with — trace_gc, the details of each V8 heap space after each GC will be displayed.
  • — trace_gc_nvp: When it is enabled, some detailed key-value pairs for each GC will be displayed, including GC type, pause time, memory changes, and other information.

Better GC Log Display

  • The total pause time of GC is as high as 47.8s, and the Scavenge GC accounts the majority of the total GC operations.
  • In the 3-minute GC Trace log, 988 Scavenge collections were performed in total.
  • The average time consumed by each Scavenge is 50–60 ms.

Optimize the Young Generation GC

Conclusion

Original Source

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to hire and vet Angular developers in 2020

React.js — Ways to Bind Events

Don’t be scared of Recursion

Reflecting business logic rules into the domain models using typescript — Part 1

Reflecting business logic rules into the domain models

Games to Play

Screenshot of a web app that creates a list.

Data types in Javascript

WebVR: A glimpse

Deep dive into JS Promises & Callbacks| IIFE | ES6 Features | Version Controlling | NoSQL

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Containerized Automation

Setting Up a Load Balancer With HAProxy

Enabling SSL on PostgreSQL

SAML Bearer Grant with WSO2 API Manager & Identity Server