coocood/freecache

when to use debug.setGCPercent

Closed this issue · 4 comments

I wonder when to use debug.setGCPercent, if my server is 16G, and the program use a little memory, then I want to use freecache to reduce the request for upstream server, if I use 4G
to pre-alloc the memory, should I use debug.setGCPercent to control the gc frequecy?

If you use 4GB for freecache, then the memory usage may go up to 8GB if you don't setGCPersent.
If you server is 16GB, it's ok to not use setGCPersent.

@coocood thanks, if I set 50% then it will GC when memory is 6G

@coocood when I use 4GB, memory may go up to 8GB. This memory means the memory for cache or the whole memory of process?

@hy05190134
The whole memory of the process.