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

[Bug] Potential memory exhaustion when a high number of classes exist at multiple levels in the DOM #85

Open
Dogfalo opened this issue Sep 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Dogfalo
Copy link

Dogfalo commented Sep 4, 2024

This can lead to a situation where the code is trying to generate a high number of combinations.
In my case it was generating over 300 million combinations at which point it used up over 32 GB ram.

This all happens before the config.threshold check so modifying that option does not prevent this scenario.

finder/finder.ts

Lines 150 to 152 in 77d3315

const paths = sort(combinations(stack))
if (paths.length > config.threshold) {
return fallback ? fallback() : null

#84 This PR fixes this.

@antonmedv antonmedv added the bug Something isn't working label Sep 4, 2024
@antonmedv
Copy link
Owner

Yeap. We should add threshold to combinations.

@Dogfalo
Copy link
Author

Dogfalo commented Sep 5, 2024

@antonmedv What do you think about the proposed PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants