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

Doesn't release memory until job queue is empty? #85

Open
rapier1 opened this issue Feb 14, 2020 · 1 comment
Open

Doesn't release memory until job queue is empty? #85

rapier1 opened this issue Feb 14, 2020 · 1 comment

Comments

@rapier1
Copy link

rapier1 commented Feb 14, 2020

I have an application using Thread Pool that will often result in job queues of more than 25,000 jobs. This is expected and the delay in processing the jobs isn't a problem. However, the memory consumed by the queue doesn't seem to be released once the job is executed. At peak the resident memory of the application might reach 1GB when the job queue is peaking. However, when the job_queue reaches zero the resident memory is largely cleared.

I've run everything through valgrind multiple times and it's not indicating any memory leaks when the application shuts down gracefully. When I put in a dummy call back that keeps the queue at a minimum size the memory consumption is pretty low. The only thing that seems related to the total memory consumption is the job queue length. That the resident memory clears once the queue is empty is odd to me. Do you have any suggestions?

Thanks

@yw1573
Copy link

yw1573 commented Apr 18, 2024

I guess you are referring to the 'jobqueue_destroy' function
This function is only used in 'thpool_destroy', and the release queue should only be called when the thread pool is released.
Here is the author's explanation

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

No branches or pull requests

2 participants