finder icon indicating copy to clipboard operation
finder copied to clipboard

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

Open Dogfalo opened this issue 1 year ago • 2 comments

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.

https://github.com/antonmedv/finder/blob/77d33158440dfffee4a300d2975b43a5283004ab/finder.ts#L150-L152

#84 This PR fixes this.

Dogfalo avatar Sep 04 '24 21:09 Dogfalo

Yeap. We should add threshold to combinations.

antonmedv avatar Sep 04 '24 23:09 antonmedv

@antonmedv What do you think about the proposed PR?

Dogfalo avatar Sep 05 '24 15:09 Dogfalo