Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Linux chip-tool : Memory may leak when try to control device after subscription #26028

Closed
MengdiHe opened this issue Apr 9, 2023 · 3 comments · Fixed by #33838
Closed
Labels
chip-tool stale Stale issue or PR

Comments

@MengdiHe
Copy link

MengdiHe commented Apr 9, 2023

Reproduction steps

step 1.start linux chip-tool in interactive mode
./chip-tool interactive start
step 2.use chip-lighting-app as TH, and commission it using linux chip-tool
pairing onnetwork 10 20202021
step 3.send on/off command to chip-lighting-app
on-off on 10 1
step 4.Repete step 4 maybe 10 or 20 times. Compare memory difference
ps aux | grep chip-tool
Then you can see that the VMRSS will grow instantly, or you can use cat /proc/[pid]/status, you will see that the vmdata keep growing after every command

Bug prevalence

Whenever I do this

GitHub hash of the SDK that was being used

e2fa6ba

Platform

other

Platform Version(s)

ubuntu 22.04

Anything else?

Actually, I tried it on Nov 2022 sdk version, which has the same result of the version above.
I don't know if I missed some key points.
We are now developing the controller program based on the chip-tool program. It will be appreciated if you can answer this issue!

@MengdiHe
Copy link
Author

Finally I find that it's related with the pesistentstorage that will be init every time.
So I add a member value to record the name. If init next time, compare name with the record name first, and return directly if they are same. I dont know if this is a right way to solve this problem......

@MengdiHe
Copy link
Author

Finally I find that it's related with the pesistentstorage that will be init every time. So I add a member value to record the name. If init next time, compare name with the record name first, and return directly if they are same. I dont know if this is a right way to solve this problem......

I find the following code comment:

// TODO: It's pretty weird that we re-init mCommissionerStorage for every
// identity without shutting it down or something in between...

@stale
Copy link

stale bot commented Oct 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chip-tool stale Stale issue or PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants