You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that the heap allocated bytes keep increasing when logging with EspLogger, then the program will crash when there is no free heap to use. I use heap_caps_get_info to observe the heap status.
Here are the dependencies
I did some tests and simulate on Wokwi, it seems like the problem is from fwritehttps://github.com/esp-rs/esp-idf-svc/blob/master/src/log.rs#L15C1-L24
If we comment this part of code, then there is no memory issue.
If the slice length is less than 4, there there is no memory issue too. It's very weird.
Can anyone help to take a look what's the problem in EspLogger?
Thanks.
[UPDATE]
I remove a log of a task which run every 10ms, then it seems the memory issue doesn't occur.
Maybe we shouldn't log too fast or make too many logs?
The text was updated successfully, but these errors were encountered:
Did you send your logs through uart?(E.g the default log channel) You may were constrained by the throughput there and logs just kept on pilling up. In that case there is not to much we can do.
I close this issue for now as it doesn't have any immediate actionable item. Feel free to reopen it if you stumble on a related problem again. Thanks!
I found out that the heap allocated bytes keep increasing when logging with
EspLogger
, then the program will crash when there is no free heap to use. I useheap_caps_get_info
to observe the heap status.Here are the dependencies
I did some tests and simulate on Wokwi, it seems like the problem is from
fwrite
https://github.com/esp-rs/esp-idf-svc/blob/master/src/log.rs#L15C1-L24If we comment this part of code, then there is no memory issue.
If the slice length is less than 4, there there is no memory issue too. It's very weird.
Can anyone help to take a look what's the problem in
EspLogger
?Thanks.
[UPDATE]
I remove a log of a task which run every 10ms, then it seems the memory issue doesn't occur.
Maybe we shouldn't log too fast or make too many logs?
The text was updated successfully, but these errors were encountered: