Re: [go-nuts] Re: Unable to find small memory leak

2021-02-21 Thread Miles Hex
Hi, thanks to everyone for the suggestions, It seems that there is in fact not a memory leak (still not totally sure), but for some reason, the go runtime keeps allocating memory event when is not needed, I think the problem is in the interaction from the memory model of the go runtime with a L

Re: [go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Robert Engels
Are you using CGo or libraries that use CGo? If so, you probably have an off-heap, i.e malloc() leak > On Feb 11, 2021, at 11:11 AM, Tom Mitchell wrote: > >  > >> On Thu, Feb 11, 2021 at 3:40 AM Uli Kunitz wrote: >> You are writing: The device crashes with out of memory. What does crash? T

Re: [go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Tom Mitchell
On Thu, Feb 11, 2021 at 3:40 AM Uli Kunitz wrote: > You are writing: The device crashes with out of memory. What does crash? > The Go program, another program or the kernel? Can you share the error > message? Can you share the log file for one day of GODEBUG=gctrace=1? > > In bash do: > > $ expor

[go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Uli Kunitz
You are writing: The device crashes with out of memory. What does crash? The Go program, another program or the kernel? Can you share the error message? Can you share the log file for one day of GODEBUG=gctrace=1? In bash do: $ export GODEBUG=gctrace=1 $ 2>error.log On Thursday, February 11,

[go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Miles Hex
To be honest, i'm not totally sure, what is see is that memory keep raising until the device crash for out of memory, but what does it mean if reachable object remain constant, but the " Heap objects" keep raising? Even when i manualy trigger the GC! Also the reachable object is not exported fro

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Uli Kunitz
I looked at your data again. Are you sure that you have a memory leak? According to the heap dump you have less reachable objects after 7 days than before. The reachable object size is in both cases 1.6 MByte. The live heap is a little bit larger than seven days before, but is probably caused b

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Miles Hex
Thank you, tomorrow i will try it! Do you know if it possible to enable it without changing the enviroment variable? My application is started by another one and i can't (easily) change the enviroment variables. On Tuesday, February 9, 2021 at 8:57:36 PM UTC+1 Uli Kunitz wrote: > It is GODEBUG=

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Uli Kunitz
It is GODEBUG=allocfreetrace=1 . Documentation for GODEBUG can be found here: https://pkg.go.dev/runtime On Tuesday, February 9, 2021 at 8:39:27 PM UTC+1 Uli Kunitz wrote: > GODEBUG=allocfreetrace may be what you are looking for. You might want to > check the output with sort | uniq -c. > > On

[go-nuts] Re: Unable to find small memory leak

2021-02-09 Thread Uli Kunitz
GODEBUG=allocfreetrace may be what you are looking for. You might want to check the output with sort | uniq -c. On Tuesday, February 9, 2021 at 8:05:23 PM UTC+1 Miles Hex wrote: > > Hi, > > I'm using golang (1.15.6) to write a daemon that handle system > task(network, time, updates, etc..) in