-
Hi, When I check PHP memory usage with Is it expected behavior? Why is the difference that big? Is there any way to free up the memory? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hey @dobryy 👋🏻 |
Beta Was this translation helpful? Give feedback.
Hey @dobryy 👋🏻
I'm not a PHP dev, so correct me if I'm wrong, but
memory_get_usage
shows only currently allocated memory by the PHP script, butrr workers
shows allocated RSS memory by the whole PHP process. On Linux, RR reads/proc/<pid>/statm
, which is inaccurate (according to the man-pages) because it might include the currently swapped-out pages.