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/python host reference cycle #111

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Conversation

TheEdward162
Copy link
Contributor

@TheEdward162 TheEdward162 commented Oct 11, 2023

Description

Fixes Python memory leak caused by creating a reference cycle between wasm Engine and wasm imports/callbacks

Motivation and Context

Discovered during initial performance testing (see #108), this is leaking memory (it's only freed on python process shutdown, which is incorrect)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Copy link
Member

@freaz freaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for finding and fixing it.

@@ -68,7 +69,7 @@ class _PerformState:
security: SecurityValuesMap
result: Optional[Any] = None
error: Optional[PerformError] = None
exception: Optional[UnexpectedError] = None
exception: Union[None, UnexpectedError, ValidationError] = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@TheEdward162 TheEdward162 merged commit 2501a44 into main Oct 12, 2023
5 checks passed
@TheEdward162 TheEdward162 deleted the fix/python_host_reference_cycle branch October 12, 2023 09:39
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.

2 participants