1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-12-04 09:42:31 +02:00
imgproxy/memory/stats.go

24 lines
478 B
Go
Raw Normal View History

2021-04-26 13:52:50 +02:00
package memory
import (
"runtime"
log "github.com/sirupsen/logrus"
2021-09-30 16:23:30 +02:00
"github.com/imgproxy/imgproxy/v3/vips"
2021-04-26 13:52:50 +02:00
)
func LogStats() {
var m runtime.MemStats
runtime.ReadMemStats(&m)
log.Debugf(
"GO MEMORY USAGE: Sys=%d HeapIdle=%d HeapInuse=%d",
m.Sys/1024/1024, m.HeapIdle/1024/1024, m.HeapInuse/1024/1024,
)
log.Debugf(
"VIPS MEMORY USAGE: Cur=%d Max=%d Allocs=%d",
int(vips.GetMem())/1024/1024, int(vips.GetMemHighwater())/1024/1024, int(vips.GetAllocs()),
)
}