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

Fix free heap memory decreasing #278

Closed
wants to merge 1 commit into from

Conversation

seiuryuu
Copy link
Contributor

@seiuryuu seiuryuu commented Aug 9, 2024

After checking the recent commits, I found this phenomenon starts after adding the overheat mode feature.

The nvs_config_get_u16 function is used in the while statement in SYSTEM_task to get the current status. After I checked the code of this function, I found that the function that returns the default value is called before nvs_close(handle). After changing the calling order, the phenomenon of free heap memory decreasing disappeared.

@skot
Copy link
Owner

skot commented Aug 9, 2024

we need to get the call to nvs_config_get_u16() out of that loop as well.

@seiuryuu
Copy link
Contributor Author

seiuryuu commented Aug 9, 2024

I think it is better to do a once catch from nvs and store it in GLOBAL_STATE. I will try to do some modifies when free.

@seiuryuu
Copy link
Contributor Author

Already got a fix in branch 219-leak_hunting

@seiuryuu seiuryuu closed this Aug 11, 2024
@shufps
Copy link
Contributor

shufps commented Aug 23, 2024

found the same coincidentally and created a PR for that to fix all nvs related problems:

#305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants