-
Notifications
You must be signed in to change notification settings - Fork 393
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
Maybe Memory leak with the latest version #89
Comments
expand function cost additional memery than specified init |
When the values and keys are small, |
这个很明显是bug且不符合预期吧。为什么不能逐出一部分空间而是申请新空间呢? |
What is the reason for this design?Why not release memory but apply for new memory. |
Because entry pointers memory is allocated separated, there is no limit for it. |
Does that mean Freecache will use more memory than i initialized in NewCache()? Can you provide a more detailed explanation about why expand() uses continuously growing memory instead of clearing unused data? Thanks. |
The unused data is cleared, when you repeatedly insert and delete entries, it doesn't grow anymore. but the allocated memory is not shrinked in case more entries need to be added later. |
For allocated memory, you mean seg's slosData array? And why allocated memory is not shrinked, doesn't it cause memory usage continually growing and destined to OOM? |
So the reason why the expand() function occupies excessive memory is that Freecache stores too many entries. To solve this issue, the solution is to reduce the memory size of Freecache and avoid caching such a large number of entries? |
yes |
if so, seems like not recommend to use this lib if i have to cache large number of entries??? in live env, memory keeps increasing with this lib |
but how many space should i reserve for expand? |
i find it a little memory leak with the latest version
i try to use tag 1.0.1 then everything is ok
The text was updated successfully, but these errors were encountered: