Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-04-03 Thread Shlomi Amit
So, I've configured pprof over http and downloaded the goroutines stack trace, apparently I did have an unintended endless recursion (1 additional function call every 5s) and I've fixed the issue. stackInUse is now normal. If I understand correctly, now it also makes sense why stackInUse didn't inc

Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-03-27 Thread robert engels
Because they are tracked separately. See allocSpan() in mheap.go. > On Mar 27, 2022, at 11:50 AM, Shlomi Amit wrote: > > Thank Robert. > My C code does call back Go code, but no recursion there. > If stack allocations are part of the heap, why it is not reflected in > heapAlloc and pprof? > >

Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-03-27 Thread Shlomi Amit
Thank Robert. My C code does call back Go code, but no recursion there. If stack allocations are part of the heap, why it is not reflected in heapAlloc and pprof? On Sun, Mar 27, 2022, 18:52 robert engels wrote: > Neither of those track C allocations - unless the C is calling back into > Go. > >

Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-03-27 Thread robert engels
Neither of those track C allocations - unless the C is calling back into Go. You can review the low level usage in stack.go Note that Go stack allocations are for the most part done in the heap, and are dynamically managed across Go routines. Are you possibly doing some very deep recursions are

Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-03-26 Thread Shlomi Amit
I've already checked process threads using ps command, and threads are not leaking. Still, it is more than possible that there are memory leaks within my Cgo code, or gstreamer as well (Which I'm running with Cgo as well) But before I'm starting to chase this path, I would like to be sure heapSys

Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-03-26 Thread robert engels
Are you certain your CGo code isn’t creating threads? > On Mar 26, 2022, at 1:10 PM, Shlomi Amit wrote: > > Yes. I already monitoring the runtime stat of number of go routines (Can be > seen in the screenshot as well) and it's not increasing. > > On Sat, Mar 26, 2022, 20:40 robert engels

Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-03-26 Thread Shlomi Amit
Yes. I already monitoring the runtime stat of number of go routines (Can be seen in the screenshot as well) and it's not increasing. On Sat, Mar 26, 2022, 20:40 robert engels wrote: > Are you certain the number of Go routines is not increasing - each Go > routine requires stack. See https://tpas

Re: [go-nuts] Investigating suspected memory leak based on StackInUse or HeapSys stats

2022-03-26 Thread robert engels
Are you certain the number of Go routines is not increasing - each Go routine requires stack. See https://tpaschalis.github.io/goroutines-size/ > On Mar 24, 2022, at 3:18 PM, Shlomi Amit wrote: > > Hi. > > I’m trying to find a memory leak in my application. > I’ve added some runtime memory sta