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

Memory leak #134

Closed
runk opened this issue Oct 3, 2023 · 6 comments
Closed

Memory leak #134

runk opened this issue Oct 3, 2023 · 6 comments

Comments

@runk
Copy link
Contributor

runk commented Oct 3, 2023

Hello, I want to draw your attention to a memory leak problem that's reported for maxmind I maintain: runk/node-maxmind#740

The only change between "good" and "bad" version of maxmind is the version upgrade of tiny-lru in September. Releases with notes: https://github.com/runk/node-maxmind/releases

Do you have any clues what this could be?

@avoidwork
Copy link
Owner

avoidwork commented Oct 4, 2023

Yes, a bug in their code.

@avoidwork
Copy link
Owner

I looked at your code briefly, but it's hard to follow where you're using the cache between the modules.

If you look at 11.1.2...11.2.0 the only difference that could cause your behavioral change is making 'has()' public, which historically is known to be a problem if anything external makes an assumption on the boolean it returns without considering lazy expiration.

11.1.2 to 11.2.0 exposes 'has()' and exports the class.

@avoidwork avoidwork reopened this Oct 4, 2023
@avoidwork
Copy link
Owner

in 11.1.2 a statement was deleted which may be the cause of the leak if it leaves orphans in ram. it doesn't have test coverage.

11.1.1...11.1.2#diff-79389319fa7fe3ff2ff6e0d5c97a626b12d8a2c72323e8ad210f43c8f98b1d60L129

@avoidwork
Copy link
Owner

Fix has shipped in 11.2.1.

@avoidwork
Copy link
Owner

@runk
Copy link
Contributor Author

runk commented Oct 4, 2023

Thanks for looking into!

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