forked from TrueCloudLab/rclone
rc: add core/gc to run a garbage collection on demand
This commit is contained in:
parent
573ef4c8ee
commit
3a2248aa5f
2 changed files with 23 additions and 0 deletions
|
@ -97,6 +97,12 @@ Eg
|
||||||
The format of the parameter is exactly the same as passed to --bwlimit
|
The format of the parameter is exactly the same as passed to --bwlimit
|
||||||
except only one bandwidth may be specified.
|
except only one bandwidth may be specified.
|
||||||
|
|
||||||
|
### core/gc: Runs a garbage collection.
|
||||||
|
|
||||||
|
This tells the go runtime to do a garbage collection run. It isn't
|
||||||
|
necessary to call this normally, but it can be useful for debugging
|
||||||
|
memory problems.
|
||||||
|
|
||||||
### core/memstats: Returns the memory statistics
|
### core/memstats: Returns the memory statistics
|
||||||
|
|
||||||
This returns the memory statistics of the running program. What the values mean
|
This returns the memory statistics of the running program. What the values mean
|
||||||
|
|
|
@ -57,6 +57,16 @@ The most interesting values for most people are:
|
||||||
* HeapSys: This is the amount of memory rclone has obtained from the OS
|
* HeapSys: This is the amount of memory rclone has obtained from the OS
|
||||||
* Sys: this is the total amount of memory requested from the OS
|
* Sys: this is the total amount of memory requested from the OS
|
||||||
* It is virtual memory so may include unused memory
|
* It is virtual memory so may include unused memory
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
Add(Call{
|
||||||
|
Path: "core/gc",
|
||||||
|
Fn: rcGc,
|
||||||
|
Title: "Runs a garbage collection.",
|
||||||
|
Help: `
|
||||||
|
This tells the go runtime to do a garbage collection run. It isn't
|
||||||
|
necessary to call this normally, but it can be useful for debugging
|
||||||
|
memory problems.
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -112,3 +122,10 @@ func rcMemStats(in Params) (out Params, err error) {
|
||||||
out["OtherSys"] = m.OtherSys
|
out["OtherSys"] = m.OtherSys
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do a garbage collection run
|
||||||
|
func rcGc(in Params) (out Params, err error) {
|
||||||
|
out = make(Params)
|
||||||
|
runtime.GC()
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue