-
Notifications
You must be signed in to change notification settings - Fork 601
Open
Labels
Description
What is the issue you are having?
I have deployed the version 3.0.2 and I thought this issue: #117 meant it was solved.
I have a constant flow of the below messages on my logs.
Can you help me understand how to fix this?
What is BigCache doing that it shouldn't?
It should not log this every few milliseconds :
2023/06/05 02:37:51 Allocated new queue in 92.911µs; Capacity: 614400
2023/06/05 02:37:50 Allocated new queue in 81.841µs; Capacity: 614400
...
Minimal, Complete, and Verifiable Example
When asking a question about a problem caused by your code, you will get much better answers if you provide code we can use to reproduce the problem. That code should be...
- ...Minimal – Use as little code as possible that still produces the same problem
- ...Complete – Provide all parts needed to reproduce the problem
- ...Verifiable – Test the code you're about to provide to make sure it reproduces the problem
For more information on how to provide an MCVE, please see the Stack Overflow documentation.
Environment:
- Version (git sha or release): NA
- OS (e.g. from
/etc/os-release
or winver.exe): alpine3.15 - go version: golang:1.17.9
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
janisz commentedon Jun 5, 2023
Could you share your config and example payload to help reproduce it?
Matias-Barrios commentedon Jun 5, 2023
Sure. Here is my constructor:
And here is getting a key:
janisz commentedon Jun 5, 2023
OK, looks like a bug. If I understand correctly, bigcache allocates array every 1 ms but instead of growing array (which will be expected) it allocates the same size. What is not clear for me is the
HardMaxCacheSize
what's exact value passed here? Maybe it's a typo and instead of 600MB we have614400
and that will explain why it does so. If this is the case then we should add a check if we are really growing the array and if not skip it and do not display confusing message.bigcache/queue/bytes_queue.go
Lines 108 to 116 in cffbf48
Matias-Barrios commentedon Jun 5, 2023
In that value I am passing this number: 600. It was meant to use 600MB of RAM to cache stuff. Is not a plain int of megabytes I have to provide there?