question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory leaks and high CPU usage with typescript on dev mode

See original GitHub issue

Prerequisites

  • 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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
StarpTechcommented, Jun 17, 2021

If it is really a problem. It can be reduced by disable type-checking. https://github.com/TypeStrong/ts-node#typechecking

1reaction
mhmd-22commented, Jun 17, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found