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

CachedInputFileSystem OOM when duration is infinity #368

Open
Jack-Works opened this issue Dec 5, 2022 · 5 comments
Open

CachedInputFileSystem OOM when duration is infinity #368

Jack-Works opened this issue Dec 5, 2022 · 5 comments

Comments

@Jack-Works
Copy link

new enhanced.CachedInputFileSystem(fs, Infinity)

I want to have a never-expire cache but infinity crashes with OOM

@alexander-akait
Copy link
Member

Because in this case we store all readed files and so you have OOM

@Jack-Works
Copy link
Author

Hmm, it crashes with OOM without resolving any file.

for (let i = 5000; i < duration; i += 500) this._levels.push(new Set());

It dies in this loop.

@alexander-akait
Copy link
Member

Oh, I see, do you want to send a fix?

@Jack-Works
Copy link
Author

👀 I don't familiar with how this work

@alexander-akait
Copy link
Member

Just add checks on Infinity:

And couple of tests, it is exotic usage, so if you need it as soon as possible, I would advise you to implement it yourself

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

2 participants