1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-12-23 22:11:10 +02:00
Files
imgproxy/memory/stats.go
2025-09-21 20:13:27 +06:00

27 lines
463 B
Go

package memory
import (
"log/slog"
"runtime"
"github.com/imgproxy/imgproxy/v3/vips"
)
func LogStats() {
var m runtime.MemStats
runtime.ReadMemStats(&m)
slog.Debug(
"GO MEMORY USAGE",
"sys", m.Sys/1024/1024,
"heap_idle", m.HeapIdle/1024/1024,
"heap_inuse", m.HeapInuse/1024/1024,
)
slog.Debug(
"VIPS MEMORY USAGE",
"cur", int(vips.GetMem())/1024/1024,
"max", int(vips.GetMemHighwater())/1024/1024,
"allocs", int(vips.GetAllocs()),
)
}