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

GH-338 allow garbage collection of non-daemon processes #339

Merged
merged 1 commit into from
Aug 17, 2024
Merged

Conversation

spyoungtech
Copy link
Owner

As described in #338 use of atexit.register in AsyncAHKProcess causes a reference to be held for the subprocess. In use cases that make heavy use of run_script or calls with blocking=False, this can lead to buildup of memory. The rate of growth can be dependent on the size of the value returned by the script and how often it is called.

This PR fixes this issue by avoiding the need for atexit.register for these two scenarios. atexit.register is still used for the long-running daemon process to ensure cleanup.

@coveralls
Copy link

Coverage Status

coverage: 76.87% (+0.2%) from 76.659%
when pulling 62e5940 on gh-338
into 46bce5c on main.

@spyoungtech
Copy link
Owner Author

This might also resolve #332

@spyoungtech spyoungtech merged commit 818b370 into main Aug 17, 2024
13 checks passed
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