Memory leaks and high CPU usage with typescript on dev mode
See original GitHub issuePrerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure it has not already been reported
Fastify version
3.0.0
Plugin version
cli-2.13.0
Node.js version
16.3.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10
Description
When running “npm run dev” with the default typescript template that comes with cli. a crazy continuous memory leak and high CPU usage occur. sometimes it hits close to 1GB and 10% usage on 8 core CPU which is not good. the problem doesn’t occur on npm run start or javascript template.
Steps to Reproduce
1- run fastify generate test --lang=ts
2- run npm run dev
Expected Behavior
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Finding And Fixing Node.js Memory Leaks: A Practical Guide
An introduction to memory debugging, from identifying causes to fixing leaks, using Chrome DevTools, and illustrated by simple examples.
Read more >Node.js Memory Leak Detection: How to Debug & Avoid Them
js app's CPU and memory usage increases over time for no apparent reason. In simple terms, a Node. js memory leak is an...
Read more >How to avoid memory leaks in your Angular application
In this article I will show you an example of a memory leak in a real world example and the proper steps to...
Read more >Debugging Memory Leaks in Node.js Applications - Toptal
Memory leaks in long running Node.js applications are like ticking time bombs that, if left unchecked in production environments, can result in devastating ......
Read more >How to Find, Fix, and Prevent Node.js Memory Leaks
This post looks at what memory leaks are and how to avoid them in Node.js ... metrics such as memory and CPU usage...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If it is really a problem. It can be reduced by disable type-checking. https://github.com/TypeStrong/ts-node#typechecking
As @StarpTech said. it’s looks like a tooling issue with typescript. I tried different type of projects and the memory consumption is consistent depending on the project size. I’ll close the issue for now as it’s not affect the production.