On Thu, Nov 16, 2017 at 9:26 AM, Christian LeMoussel <cnh...@gmail.com> wrote: > > Go has the GOGC variable, that can also be controlled with the SetGCPercent > function in the runtime/debug package. > Is it possible to find the optimal value of GOGC to get the most op / s per > report to the number of cores?
The default value is chosen to work well for most programs. That said, if you want to look into this, it obviously depends on the behavior of your program and the available resources. If your program is a client that does not run for very long, then a very large GOGC value is likely to be appropriate, to let the client run and exit without spending unnecessary time collecting garbage. If your program is a long running server, then it is going to reach some sort of memory steady state. If you leave GOGC at the default value of 100, then the memory steady state will be very approximately twice as much memory as your program requires. If you have resources available to let your program use more memory in the steady state, then adjust GOGC accordingly. For example, if it's OK for your program to use twice as much memory, set GOGC to 200. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.