Den tisdag 22 januari 2019 kl. 22:14:20 UTC+1 skrev Ian Lance Taylor: > > On Tue, Jan 22, 2019 at 11:21 AM Patrik Iselind <patri...@gmail.com > <javascript:>> wrote: > > > > I'm looking at memory profiles and have a hard time interpreting what I > see. I'm trying to better understand what I am looking at in `go tools > pprof` why looking at the raw data. All 'groups' at the end of output from > /debug/pprof/heap have lines that begin with "0: 0 [0: 0] @0x.......". It's > these zeros I cannot wrap my head around. > > > > As I read the source code for pprof, I interpret the zeros as; there are > zero inuse object and there has never been any allocations for the > following call stack. This seem like a really strange interpretation, why > save a call stack from which there has never been made any allocations? How > am I supposed to interpret it? > > > > That line format follows the format of "n: m [N: M] @0x...." where, as I > interpret the source code, we have > > n = number of objects that are in use and allocated using the call stack > just below > > m = how many bytes these n objects occupy > > N = number of object ever allocated using the call stack just below > > M = how many bytes these m objects occupy > > > > n and m has to do with what is called the inuse_object and inuse_space > respectively. > > N and M has to do with what is called the alloc_object and alloc_space > respectively. > > > > It might just be my interpretation of inuse and alloc. I see inuse as > something that still has a reference to it while alloc show the total count > of objects allocated at a certain call stack. Given this interpretation, I > cannot see how zeros make sense. > > > > Please help me understand. > > I'm not sure but I think you will get entries like that for cases for > which an allocation occurred but the memory was then freed by the GC >
That seem strange to me. That would mean that the garbage remains, even after it has been collected. That cannot be so... > before the profile record was requested. > > 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. For more options, visit https://groups.google.com/d/optout.