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

Managing User Permissions in a VueJS App

Vscode extension kill-process

Build this simple video player with react native and expo to tell a multi-part story -Part 4

Weeding Out Your ES6 Webpack Bundle Sizes

SOLID Design Principles

25 TypeScript Interview Questions For Beginners — DotNetCrunch

Cypress Library e2e with Angular Project

Do You Really Need a Full-Stack Developer?

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

A Mana-based RateLimiter

OAuth 2.0 with Passport.js Part — 1

HTTP Upgrade using REST in NodeJS (Practical Example)

5/24 leet code log