-
Notifications
You must be signed in to change notification settings - Fork 140
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
Memory leak on Linux with repeated device connections #252
Comments
I think the example code is good, instead there could be a problem in gap_linux.go. I see the number of goroutines keep incrasing together with memory usage, even after trying to connect once. I can't see anywhere Lines 326 to 331 in d0c7887
I forked and added a They are trying to remove the dependency on muka/bluetooth, so I doubt this will be fixed. |
This seems to have been fixed in the latest v0.9.0 - When simply connecting to a device and disconnecting the memory no longer increases and will remain fairly stable. There is however increasing memory usage when connecting to a device and enabling notifications as mentioned in #260. |
Expanding on the example
heartbeat-monitor
, I'm getting what appears to be a memory leak when re-connecting to a device after the first connection.An example use case:
Example code, edited slightly from the source:
Go version: 1.22.1
tinygo/x/bluetooth: 0.8.0
Compiling onto Linux Arm64, with a IW416 SOC
Am I doing anything wrong based on the example code? The only real difference here is the added loop, which (hopefully) allows for scanning and connecting to different devices. (I need to be able to connect to multiple devices with various different services at unknown times, so this is just attempting to get the basics working, so I need the ability to restart the scan once the operation on the current device is finished)
Any ideas?
The text was updated successfully, but these errors were encountered: