You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @JLHwung! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.
Nice catch! The leak is gone when closeInputAst is disabled. However this option is enabled by default.
It is likely that after cloneDeep is performed, the new AST object still contains reference to the old AST object which prevents them from being collected.
💻
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
For a complete reproduction, see https://github.com/JLHwung/babel-transform-from-ast-leak
Configuration file name
No response
Configuration
N.A.
Current and expected behavior
Current: The memory usage rises beyond 2GB
Expected: The memory usage should be stable during repetitive
transformFromAstSync
calls.Environment
System:
OS: macOS 12.0.1
Binaries:
Node: 17.0.1 - /opt/homebrew/bin/node
Yarn: 1.22.17 - /opt/homebrew/bin/yarn
npm: 8.1.0 - /opt/homebrew/bin/npm
npmPackages:
@babel/core: ^7.16.0 => 7.16.0
Possible solution
No response
Additional context
Found this issue when running
jest --detect-leaks
in the Babel codebase.transformFromAstAsync
andtransformFromAst
are also affected.When switching
transformFromAstSync
totransformSync
, the memory leakage can not be reproduced.The text was updated successfully, but these errors were encountered: