Skip to content

Add object source logger to profiler#90650

Merged
balloob merged 14 commits into
devfrom
object_source_logger
Apr 3, 2023
Merged

Add object source logger to profiler#90650
balloob merged 14 commits into
devfrom
object_source_logger

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Apr 1, 2023

I tagged this for beta since the risk is low given the only change affects debugging tools (profiler) and I didn't want to go another month without finding this leak.

Proposed change

To find the source of #89885 since its leaking dict objects, and its not realistic to expect a user to find the leak by comparing a list of 80000 dicts manually.

profiler.start_log_object_sources and profiler.stop_log_object_sources provide additional services for hunting memory leaks. These services do more intensive attempts to locate the source of a leak. This new service is designed to find fast leaks of common objects like dict. These services are useful for cases where the less intensive profiler.start_log_object cannot provide useful information when there are 10000+ objects of the same type in memory with the same name as the object that is being leaked.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

Comment thread homeassistant/bootstrap.py Outdated
@bdraco bdraco added this to the 2023.4.0 milestone Apr 2, 2023
@bdraco bdraco marked this pull request as ready for review April 2, 2023 19:14
@balloob balloob merged commit 51ff027 into dev Apr 3, 2023
@balloob balloob deleted the object_source_logger branch April 3, 2023 00:54
balloob pushed a commit that referenced this pull request Apr 3, 2023
* Add object source logger to profiler

* fixes

* cleanup

* tweaks

* logging

* logging

* too intensive

* adjust

* Update homeassistant/bootstrap.py

* fixes

* fixes

* coverage
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants