fastcache icon indicating copy to clipboard operation
fastcache copied to clipboard

Any possibility of OOM?

Open hiqbn opened this issue 6 years ago • 1 comments

I dont see any configuration settings for limiting the number of bytes or slices / elements allocated.

Thanks for the software by the way

hiqbn avatar Jun 04 '19 13:06 hiqbn

fastcache.New accepts maxBytes arg. This is the maximum cache size in bytes. The number of elements is limited by the same maxBytes arg - each element occupies at least len(key)+len(value)+len(header) bytes, where header is per-entry header with non-zero size.

valyala avatar Jun 04 '19 16:06 valyala