freecache icon indicating copy to clipboard operation
freecache copied to clipboard

Question Regarding Large Cache Size

Open chitrakojha opened this issue 9 years ago • 9 comments
trafficstars

Hi, I am trying to allocate caches larger than 4GB. Is there a plan to support int64 in the future?

chitrakojha avatar Nov 04 '16 22:11 chitrakojha

If you are on 64bit OS, int is 64bit, you are able to allocate caches larger than 4GB.

coocood avatar Nov 05 '16 00:11 coocood

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 avatar Jun 07 '18 03:06 toontong

@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.

coocood avatar Jun 07 '18 03:06 coocood

Joining to @toontong. What is meant to be "large amount of memory" ? and what percent should I set?

yoka791 avatar Nov 18 '20 12:11 yoka791

min(100, 100 * (total_memory_size - cache_memory_size) / (cache_memory_size)) may be a good number to use.

coocood avatar Nov 18 '20 12:11 coocood

max(100, 100 * (total_memory_size - cache_memory_size) / (cache_memory_size)) may be a good number to use.

you meant to min?

yoka791 avatar Nov 18 '20 12:11 yoka791

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.

coocood avatar Nov 18 '20 13:11 coocood

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)) ?

yoka791 avatar Dec 10 '20 08:12 yoka791

@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?

SupNewBeen avatar Sep 15 '23 03:09 SupNewBeen