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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.