Skip to content

Conversation

jonSeetrue
Copy link

Fix the memory leak issue.
close all workers when done processing.

@jonSeetrue
Copy link
Author

Hi @banesullivan
This pr fixes the memory issues of the open workers, could you review it, please?

@banesullivan
Copy link

Hi @jonSeetrue, I'm not an active developer or maintainer of this software nor am I familiar with the exact issue referred to here, so I don't think I'm the right person to review this.

Though, as a member of the user community, I think I can speak for everyone in saying thank you for this contribution and likely impactful fix!

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

@jonSeetrue yes, thank you for the contribution!

Can you please call terminateWorkers() from a cleanup() function on the viewer object? For performance, we want to re-use the workers on repeated calls.

@jonSeetrue
Copy link
Author

@thewtex do you mean to collect all the workers into an array on the viewer object and when loading a new image call terminateWorkers()?

@thewtex
Copy link
Member

thewtex commented Mar 22, 2023

@jonSeetrue a cleanup() function on the viewer that calls terminateWorkers() on the worker pools when called. Loading a new image will not need a call. I am not sure if an array on the viewer object is needed.

@jonSeetrue
Copy link
Author

@thewtex the worker-pool is not exported, so should the cleanup() function be part of each worker-pool implementation?

@thewtex
Copy link
Member

thewtex commented Mar 22, 2023

@jonSeetrue yes, that could work 👍

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