freecache
freecache copied to clipboard
Question Regarding Large Cache Size
Hi, I am trying to allocate caches larger than 4GB. Is there a plan to support int64 in the future?
If you are on 64bit OS, int is 64bit, you are able to allocate caches larger than 4GB.
On the README.md:
Notice:
If you allocate large amount of memory, you may need to set debug.SetGCPercent().....
then, how mush was "large amount of memory" ? 1G/process ? 4G? 8G?
@toontong SetGCPercent lower can reduce the process memory usage. Say the most of the memory is consumed by the cache. If you do not set it lower, the process may consume more than twice of the cache memory.
Joining to @toontong. What is meant to be "large amount of memory" ? and what percent should I set?
min(100, 100 * (total_memory_size - cache_memory_size) / (cache_memory_size)) may be a good number to use.
max(100, 100 * (total_memory_size - cache_memory_size) / (cache_memory_size))may be a good number to use.
you meant to min?
max(100, 100 * (total_memory_size - cache_memory_size) / (cache_memory_size))may be a good number to use.you meant to min?
Yes, fixed.
max(100, 100 * (total_memory_size - cache_memory_size) / (cache_memory_size))may be a good number to use.you meant to min?
Yes, fixed.
maybe you meant to min(100, 100 * (total_memory_size - cache_memory_size) / (total_memory_size)) ?
@toontong SetGCPercent lower can reduce the process memory usage. Say the most of the memory is consumed by the cache. If you do not set it lower, the process may consume more than twice of the cache memory.
Why process may consume more than twice of the cache memory?