webpack / enhanced-resolve

Offers an async require.resolve function. It's highly configurable.
MIT License
916 stars 186 forks source link

pathUtils | fix memory leak #418

Open Galcarmi opened 2 months ago

Galcarmi commented 2 months ago

Closes https://github.com/webpack/enhanced-resolve/issues/414

linux-foundation-easycla[bot] commented 2 months ago

CLA Not Signed

alexander-akait commented 1 month ago

@vankop What do you think about it? Yeah, we have a memory leak here, if you run develpment your application very long our cache will be bigger and bigger, so I think using lru cache is good idea, but I don't know what is will be better number for max

vankop commented 1 month ago

I personally think we dont need cache here.. maybe at first implementation there was some specific usage for resolver.join, but right now it used in a lot of cases, sometimes even on each plugin call. ( see JoinPlugins ) So probably cache hit is very low. basically happen only on the same resolving, this happens quite rarely on incremental builds

vankop commented 1 month ago

on cold builds it does not make sense either since very low cache hit

Galcarmi commented 1 month ago

@alexander-akait sorry I'm a bit busy, I'll address it at the weekend,

@vankop so do you recommend to just remove it instead?

alexander-akait commented 1 month ago

@vankop Can you test it on some repo and check it?

vankop commented 1 month ago

we have a metrics repo, we just need to setup cache hits there...