Jump to content

php in command line and memory problem


thinkpozzitive

Recommended Posts

Hi. I'm experiencing some very strange memory issues with my php script. maybe some of you have runned into this before and can help me sort out why this is happening.

I have a php script that basically runs continuously but it has various sleeps and therefore is inactive some of the time. The problem with it is that it gathers over time a lot of garbage and memory consumption grows to unacceptable levels. Therefore I've tried to do my best and unset all possible variables , arrays, etc when exiting a function and so on. The result is pretty interesting. The script still builds up memory, however since I'm running it on Windows with a Wamp enabled server, if I do an operation of minimizing or maximizing the command line window, the memory is magically cleaned up. However this only happens by human intervention (which means i have to maximize, minimize, the command line window). This behaviour seems to me to be very strange, and i can't wrap my head around the fact that memory isn't cleaned when the process is in a sleep state, and further more the memory is cleaned up when I minimize/maximize the command line window.

Now, since this almost science fiction problem has been bugging me, please , if you can, help me sort it out. Also if anyone has knowledge about this problem acctually happening on windows, but not on linux bases operating system ... please do tell. Also let me know weather it's an php.ini config issue, or what not.

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/166771-php-in-command-line-and-memory-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.