On Fri, Sep 11, 2020 at 5:01 PM Alex Mills <a...@channelmeter.com> wrote: > > The explanations I find online arent very clear to me :(
Well, OK, but I don't know what I can say other than to repeat the information from that link. Alloc is bytes of allocated heap objects. TotalAlloc is cumulative bytes allocated for heap objects. If that is not clear, what is not clear about it? Ian > On Thursday, September 10, 2020 at 6:40:34 PM UTC-7 Ian Lance Taylor wrote: >> >> On Thu, Sep 10, 2020 at 4:39 PM Alexander Mills >> <alexande...@gmail.com> wrote: >> > >> > I have this helper func to print memory usage (detect a memory leak?) >> > >> > >> > func PrintMemUsage() { >> > var m runtime.MemStats >> > runtime.ReadMemStats(&m) >> > // For info on each, see: https://golang.org/pkg/runtime/#MemStats >> > fmt.Printf("Alloc = %v MiB", bToMb(m.Alloc)) >> > fmt.Printf("\tTotalAlloc = %v MiB", bToMb(m.TotalAlloc)) >> > fmt.Printf("\tSys = %v MiB", bToMb(m.Sys)) >> > fmt.Printf("\tNumGC = %v\n", m.NumGC) >> > } >> > >> > I am seeing output like this: >> > Alloc = 2481 MiB TotalAlloc = 24038 MiB Sys = 2752 MiB NumGC = 114 >> > >> > what is the difference between Alloc and TotalAlloc .. ? >> >> The link above, after "For info on each", explains the difference. If >> the explanation is unclear, tell us more. >> >> Ian > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/6c889d9b-e2f1-4583-b310-8954ce456852n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXQ4eedgwwnxT0Hg_3%2BWmjexX1NriT26U1AksEVmrW8sg%40mail.gmail.com.