mirror of https://github.com/tidwall/tile38.git
debug.FreeOSMemory
This commit is contained in:
parent
19da27b562
commit
5d378b8ec9
|
@ -10,6 +10,7 @@ import (
|
|||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -552,7 +553,8 @@ func (c *Controller) command(msg *server.Message, w io.Writer) (res string, d co
|
|||
case "aofmd5":
|
||||
res, err = c.cmdAOFMD5(msg)
|
||||
case "gc":
|
||||
go runtime.GC()
|
||||
runtime.GC()
|
||||
debug.FreeOSMemory()
|
||||
res = server.OKMessage(msg, time.Now())
|
||||
case "aofshrink":
|
||||
go c.aofshrink()
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
|
@ -80,6 +81,7 @@ func (c *Controller) cmdServer(msg *server.Message) (res string, err error) {
|
|||
m["following"] = fmt.Sprintf("%s:%d", c.config.FollowHost, c.config.FollowPort)
|
||||
m["caught_up"] = c.fcup
|
||||
}
|
||||
m["pid"] = os.Getpid()
|
||||
m["aof_size"] = c.aofsz
|
||||
m["num_collections"] = c.cols.Len()
|
||||
m["num_hooks"] = len(c.hooks)
|
||||
|
@ -111,6 +113,7 @@ func (c *Controller) cmdServer(msg *server.Message) (res string, err error) {
|
|||
}
|
||||
m["mem_alloc"] = mem.Alloc
|
||||
m["heap_size"] = mem.HeapAlloc
|
||||
m["heap_released"] = mem.HeapReleased
|
||||
m["max_heap_size"] = c.config.MaxMemory
|
||||
m["avg_item_size"] = avgsz
|
||||
m["pointer_size"] = (32 << uintptr(uint64(^uintptr(0))>>63)) / 8
|
||||
|
|
Loading…
Reference in New Issue