rc: Add commands to set GC Percent & Memory Limit (1.19+)
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
This commit is contained in:
parent
617c5d5e1b
commit
0c56c46523
4 changed files with 131 additions and 3 deletions
12
lib/debug/common.go
Normal file
12
lib/debug/common.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Package debug contains functions for dealing with runtime/debug functions across go versions
|
||||
package debug
|
||||
|
||||
import (
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
// SetGCPercent calls the runtime/debug.SetGCPercent function to set the garbage
|
||||
// collection percentage.
|
||||
func SetGCPercent(percent int) int {
|
||||
return debug.SetGCPercent(percent)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue