-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
memory slowly leaking with high amount of tasks #235
Comments
after a couple of days of testing i can confirm: Tested inside application code by wiping every 1000 jobs:
|
@Nielsvanpach please review, when you have time |
We're open to accept a PR for this! |
iasjennen
added a commit
to iasjennen/async
that referenced
this issue
Dec 9, 2024
Since the member variables of finished/results keep growing indefinitely over time this is a source of a memory leak. This memory leak is resolvable by clearing the result caches with the newly introduced methods.
iasjennen
added a commit
to iasjennen/async
that referenced
this issue
Dec 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello,
I have the following use case:
a Spatie\Async\Pool instance runs permanently and processes a big amount of tasks.
This runs flawlessly, however over the course of days / weeks and processing >100000 tasks the main process requires more and more memory (>2GB).
I suspect the indefinite keeping of the history of finished processes and results causes the "memory leak", see src/Pool.php
...
$this->finished[$process->getPid()] = $process;
...
$this->results[] = $process->triggerSuccess();
...
I suggest to add explicit functions to do the house keeping, eg:
what do you think?
The text was updated successfully, but these errors were encountered: