如果想知道当前的内存状态,可以使用: var m runtime.MemStats runtime.ReadMemStats(&m) fmt.Printf("%d Kb\n", m.Alloc / 1024)