-
Notifications
You must be signed in to change notification settings - Fork 599
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
Inadequate memory consumption #292
Comments
Hello. Thanks for submitting this bug.
As you can see underlying bytes queue is correctly allocated and all additional data goes from I understand that documentation might be misleading. Would you like to fix it? add information that this limit only apply to bytes queue (not shards) and real memory usage depends of number of shards, entries and HardMaxCacheSize |
Thank you for explanation and additional tests. In seems, there is a dependency between cache size and shards count. Could anybody clarify how to predict memory consumption with different values of shards count? |
Probably the easiest option will be to create some tests for it. Here are some hints where memory is allocated:
|
What is the issue you are having?
Despite the limitation of the maximum cache size of 64 megabytes, the program consumes considerably more memory
I'se set HardMaxCacheSize to 64Mb (see a code below), but after programm run vmRSS was much more than 64Mb. In a real setup I've seen cache size more than 5Gb and programm was killed by OOM killer
keys count = 1
vmRSS: Pre run 19 890 176
vmRSS: Post run 20 430 848
keys count = 100
vmRSS: Pre run 19 890 176
vmRSS: Post run 74 498 048
keys count = 1000
vmRSS: Pre run 198 86 080
vmRSS: Post run 385 257 472
keys count = 5000
vmRSS: Pre run 19 894 272
vmRSS: Post run 556 134 400
What is BigCache doing that it shouldn't?
Consumes a lot of memory
Minimal, Complete, and Verifiable Example
Environment:
go version go1.17 linux/amd64
The text was updated successfully, but these errors were encountered: