Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jeevamugunthan's avatar

Queue workers not clearing memory after the jobs are done

We use a lot of background processing with workers. One problem that we have noticed that the memory is not cleared after the job finishes with processing.

we use corn jobs for run this php artisan queue:work command for each 30 minutes

0 likes
5 replies
sr57's avatar

Queue workers not clearing memory ...

1 - How do you see this ?

2- What's the problem?

2-1 Does your system use swap memory due to to this?

jeevamugunthan's avatar

@sr57 i see this in my server. the physical memory usage was gets full i contact my hosting providers regarding this problem, as they told the corn job is the problem

sr57's avatar

Total RAM memory usage is a normal/good usage form the os.

2- What's the problem?

2-1 Does your system use swap memory due to to this?

jeevamugunthan's avatar

@sr57 sorry i already mentioned the problem, if the physical memory usage gets full the site not working

and we use shared hosting we have 1GB of physical memory usage, and i don't know the system use swap memory or not

sr57's avatar

So you have to debug and for this you can use php function : memory_get[_peak]_usage

https://www.php.net/manual/fr/function.memory-get-usage.php

log values in critical part of your scripts to see if it's due to closed jobs, running jobs, ...

If you can't use a vps, try also to see the pb in local, you should have access to more data than with a shared hosting.

Please or to participate in this conversation.