Dnia 2020-09-11, o godz. 17:13:22
Alexander Mills napisał(a):
> Well why does TotalAlloc keep climbing up (increasing) in my program,
| CUMULATIVE: increasing or increased in quantity, degree, or force by
successive additions. |
It means that every allocation made _adds_ to an ever increasi
Because memory is reclaimed - the alloc is the “live” heap. TotalAlloc is a
cumulative counter of byte allocated - bytes freed do not affect the counter.
> On Sep 11, 2020, at 7:14 PM, Alexander Mills
> wrote:
>
>
> Well why does TotalAlloc keep climbing up (increasing) in my program, but
On Fri, Sep 11, 2020 at 5:01 PM Alex Mills 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 he
The explanations I find online arent very clear to me :(
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
> wrote:
> >
> > I have this helper func to print memory usage (detect a memory leak?)
> >
> >
> > func PrintMemU
On Thu, Sep 10, 2020 at 4:39 PM Alexander Mills
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
I stole the memory code from here:
https://golangcode.com/print-the-current-memory-usage/
On Thu, Sep 10, 2020 at 4:39 PM Alexander Mills
wrote:
>
> I have this helper func to print memory usage (detect a memory leak?)
>
>
> func PrintMemUsage() {
> var m runtime.MemStats
> runtime.ReadMemStats(&