Hi,

I'm using golang (1.15.6) to write a daemon that handle system 
task(network, time, updates, etc..)  in embedded device (an onion omega 
2+), and i'm encountering a small memory leak that i'm unable to identify 
and fix. 
The device is using linux 4.14.171, the architecture is mips.

At first i used "go tool pprof" and the memory profile but the "inuse" 
index is always empty, and that kinda match my expectation since the 
application spend most of his time idle awaiting commands/event (i must add 
that he leak occur even when the application is idle). I also checked the 
number of goroutine that remains constant. 

I then added some logs to try to understand when this allocation occurs 
(and the subsequent leak), but i'm unable to make sense of the data.
I also collected a couple of heapdump that i'm trying to analyze with 
"github.com/temorfeouz/heapdump14" (which is a fork of 
https://github.com/randall77/heapdump14, and the only tool i find that can 
open heapdump of go 1.15)

Following is the (partial) memstat data:

MemStast Before:
  "HeapAlloc": 1811448,
  "HeapSys": 7176192,
  "HeapIdle": 4399104,
  "HeapInuse": 2777088,
  "HeapReleased": 3358720,
  "HeapObjects": 11200,
  "StackInuse": 1212416,
  "StackSys": 1212416,

MemStat After 7 days:
  "HeapAlloc": 2033048,
  "HeapSys": 11403264,
  "HeapIdle": 8257536,
  "HeapInuse": 3145728,
  "HeapReleased": 8257536,
  "HeapObjects": 13060,
  "StackInuse": 1179648,
  "StackSys": 1179648,

I also have the summary from the two heapdump
Before:
Heap size: 8.0 MB bytes 
Heap live: 1.8 MB bytes 
Heap objects: 11496 
Reachable objects: 10492 
Reachable size: 1.6 MB bytes 

After 7 days:
Heap size: 12.0 MB bytes 
Heap live: 2.0 MB bytes 
Heap objects: 13198 
Reachable objects: 10454 
Reachable size: 1.6 MB bytes 

I have collected a lot more data, including all the profile made available 
from the go runtime and various system information.

If i'm reading this data correctly there is a memory leak as the heap si 
growing but i'm not sure how to find it! I tough i could try to diff the 
two heapdump with excel but the tool that i'm using is not very "precise" 
and a lot of type information seem to be lost.

I don't know how to make sense of this data, what would your next step? I'm 
quite new in the golang ecosystem and i'm unsure how to move from here.

Thanks.





-- 
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/cd0f3c3d-206b-4f2e-87b1-96663d970265n%40googlegroups.com.

Reply via email to