Skip to content

[12.x] Determine queue worker memory usage with getrusage if possible #56019

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

Closed
wants to merge 1 commit into from

Conversation

mzur
Copy link
Contributor

@mzur mzur commented Jun 12, 2025

I found that memory_get_usage() does not report the actual memory usage of the process, e.g. if packages such as jcupitt/vips for image processing are used. The value reported in ru_maxrss represents the actual memory usage and should be preferred if available.

Maybe related to #25738

I found that memory_get_usage() does not report the actual memory
usage of the process, e.g. if packages such as jcupitt/vips for
image processing are used. The value reported in 'ru_maxrss'
represents the actual memory usage and should be peferred if
available.
@mzur
Copy link
Contributor Author

mzur commented Jun 12, 2025

The failing test seems unrelated to this change 😕

@taylorotwell
Copy link
Member

Going to stick with memory_get_usage for now.

@mzur
Copy link
Contributor Author

mzur commented Jun 16, 2025

@taylorotwell thanks for having a look at this! Could you please explain your decision? I have a use case where memory_get_usage happily reports only 40 MB of used memory where the process actually consumes 4 GB of memory. This completely defeats the --memory option of the worker process for me which is the only option to manage the, essentially, leaking memory that is only freed with a restart of the process.

mzur added a commit to biigle/core that referenced this pull request Jun 17, 2025
The command uses a method to more accurately determine the used
memory.

See: laravel/framework#56019
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