Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogMemStats ¶
func LogMemStats(location string)
LogMemStats creates a log line of memory stats which is useful for manually debugging/validating memory consumption. This is not used in general, but is highly useful when detailed memory information is needed - in which case it is nice to have a reusable method, rather than creating it again. Place this method where needed and supply location information - e.g. "before sort" and "after sort".
This method will create a CSV file as well as write into the log.
You can acquire further information - like mem stats sampled by minute or 10sec intervals - by creating a structured log and using the utility script tools/parse-memstats-from-json-log.sh to post-process the log file.
func SetDefaultLimit ¶
func SetDefaultLimit() bool
SetDefaultLimit applies a soft memory limit for the runtime. If a user defined their own memory limit using the GOMEMLIMIT env var, this function does nothing and the requested limit is honored. As there is no simple portable way to find the available memory in the system - and we may not want to even consume a fixed percentage of that anyway - the limit is hardcoded in defaultLimit.
Types ¶
This section is empty.