Show memory usage on the version page

This commit is contained in:
2022-08-20 12:14:52 +09:30
parent da970239a5
commit 5be599589a
3 changed files with 19 additions and 0 deletions

14
meta/meta.go Normal file
View File

@@ -0,0 +1,14 @@
package meta
import (
"fmt"
"runtime"
)
func MemInfo() string {
stats := runtime.MemStats{}
runtime.ReadMemStats(&stats)
return fmt.Sprintf("%.3fMb", float64(stats.Alloc)/1024.0/1024.0)
}