Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excessive Memory Consumption Due to Token Inclusion in AST #1413

Open
Iswaryasl opened this issue Aug 21, 2024 · 0 comments
Open

Excessive Memory Consumption Due to Token Inclusion in AST #1413

Iswaryasl opened this issue Aug 21, 2024 · 0 comments

Comments

@Iswaryasl
Copy link

I'm experiencing an issue with the recast library where the memory consumption becomes excessively high due to token data being included in the AST (Abstract Syntax Tree) even when the tokens option is set to false.

Steps to Reproduce:

  1. Use the recast.parse function with the following options
    const ast = recast.parse(code, { tokens: false, loc: true });

  2. Observe the resulting AST object

Expected Behavior:

The tokens property should not be present in the resulting AST if the tokens option is set to false. Memory usage should be reasonable for the size of the AST.

Actual Behavior:

Despite setting the tokens option to false, the resulting AST still includes a tokens property, which leads to excessive memory consumption.

Additional Information:

Recast version: 0.22.0
Node.js version: 14.21.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant