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

Yaml reload causes memory % increase which is not released #112811

Closed
Mariusthvdb opened this issue Mar 9, 2024 · 12 comments · Fixed by #114602
Closed

Yaml reload causes memory % increase which is not released #112811

Mariusthvdb opened this issue Mar 9, 2024 · 12 comments · Fixed by #114602

Comments

@Mariusthvdb
Copy link
Contributor

The problem

using C t load the quick menu and reload Themes consistently ups the memory % with .2 to .5 %, whihc is not released afterwards.

A single reload is not very therefor not that noticeable, but testing themes and doing it often in a row caused this to be a significant rise.

What's more, reloading the complete Yaml (many individual components are no longer available in the Yaml reload page, so user clicks Reload all) causes the system to hang for a very long time.

could it be that

it looks like something still holds on to the old config when you reload

What version of Home Assistant Core has the issue?

2024.4.0.dev20240309

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

core

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homeassistant/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

no errors in log

Additional information

direct results of reloading Theme via 'C Themes'
Scherm­afbeelding 2024-03-08 om 17 01 21

Scherm­afbeelding 2024-03-08 om 19 34 39
@home-assistant
Copy link

home-assistant bot commented Mar 9, 2024

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (homeassistant) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homeassistant can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign homeassistant Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


homeassistant documentation
homeassistant source
(message by IssueLinks)

@schellevis
Copy link

schellevis commented Mar 17, 2024

I experience the same issue on Home Assistant Green (2024.3)

(Except the memory usage spike near 12:00, caused by ESPhome flashing)

Scherm­afbeelding 2024-03-17 om 15 39 29

@erkr
Copy link

erkr commented Mar 17, 2024

Since I updated from 2024.2.4 to 2024.3.1 I have a memory loss as well, which seems not related to specific actions:
image
Update after March the 15th. First time it raised quickly, I rebooted and since then it increases slowly

@Mariusthvdb
Copy link
Contributor Author

my issue really is on the reloading Yaml (themes) especially.

generic memory increase might better be served with another issue? and some logs if you have them.

@erkr
Copy link

erkr commented Mar 17, 2024

I have nothing in the log's, but in my case I was not making changes that require yaml reloads.
I made a separate issue: #113708

@schellevis
Copy link

To clarify: my issue is in fact related to yaml reloading.

@Ftown14
Copy link

Ftown14 commented Mar 19, 2024

I am seeing this issue as well. I am normally at ~35% usage, but last few days I have been doing lots of tweaks and reloading my YAML a lot. This has led to my memory usage increasing exponentially and rebooting is the only fix.
Screenshot_20240319-061819_Home_Assistant

@joostlek
Copy link
Member

Right, let me send the copy pasta related to performance issues:

Maybe because because of the reload the memory can rise quicker, we don't need full 4 hours, but let's see what comes out of it

bdraco added a commit that referenced this issue Apr 1, 2024
related issue #112811

When the exception hits, the config will end up being saved in the traceback
so the memory is never released.

This matches the check_config code to homeassistant.config to avoid having
the exception thrown.
@home-assistant
Copy link

home-assistant bot commented Apr 1, 2024

@bdraco
Copy link
Member

bdraco commented Apr 1, 2024

I thought it was system_log but its not

Going to have to patch traceback

@bdraco
Copy link
Member

bdraco commented Apr 1, 2024

Sadly I think I'm doing the path of another leak and not the original one being reported here

@bdraco
Copy link
Member

bdraco commented Apr 1, 2024

2024-04-01 12:51:12.803 CRITICAL (SyncWorker_10) [homeassistant.components.profiler] New object traceback (0/23) at /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py: <traceback object at 0x2de056ac0>
2024-04-01 12:51:12.803 CRITICAL (SyncWorker_10) [homeassistant.components.profiler] New object traceback (0/23) at /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py: <traceback object at 0x2de057900>
2024-04-01 12:51:12.803 CRITICAL (SyncWorker_10) [homeassistant.components.profiler] New object traceback (0/23) at /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py: <traceback object at 0x2da016f80>
2024-04-01 12:51:12.803 CRITICAL (SyncWorker_10) [homeassistant.components.profiler] New object traceback (0/23) at /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py: <traceback object at 0x2eb82d840>
2024-04-01 12:51:12.803 CRITICAL (SyncWorker_10) [homeassistant.components.profiler] New object traceback (0/23) at /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py: <traceback object at 0x2eb3958c0>
2024-04-01 12:51:12.818 CRITICAL (SyncWorker_10) [homeassistant.components.profiler] New objects overflowed by {'traceback': 18}

balloob pushed a commit that referenced this issue Apr 2, 2024
* Add missing platforms_exist guard to check_config

related issue #112811

When the exception hits, the config will end up being saved in the traceback
so the memory is never released.

This matches the check_config code to homeassistant.config to avoid having
the exception thrown.

* patch

* merge branch
balloob pushed a commit that referenced this issue Apr 2, 2024
* Add missing platforms_exist guard to check_config

related issue #112811

When the exception hits, the config will end up being saved in the traceback
so the memory is never released.

This matches the check_config code to homeassistant.config to avoid having
the exception thrown.

* patch

* merge branch
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants