php - Lowering script memory usage in a "big" file creation -


It seems that I am facing a normal memory outage problem while using a PHP script.

The script is originally developed by another person, acts as an XML Sitemap Creator, and uses large amounts of memory on large websites.

I thought the problem was kept working in memory due to a method algorithm, but digging in code I found that the script works like this:

    < Li> Open file in Output (XML Sitemap entries will be included)
  • In Loop: ---- To add each entry in Sitemap, Fillit
  • Close file
  • Termination

Although there is no huge arrays or variables Being kept in the heart, this technique uses a lot of memory.

I thought that maybe PHP was buffering under the hood at the end of the script and had "flushing" data, so I have the code modified code to close and open every ND record, But memory usage is still the same .... I'm debugging script on my computer and watching memory usage: While the script executes, memory allocation increases.

Is PHP allowed free flashing buffers if any?

Thanks

So you're looking for memory leak, a big PHP program Not written by yourself? After examining normal problems (loading heavy DB results, not flushing / closing files) without any luck, I think that you should use a profiler like XDIUU () which helps you identify memory problems is. Some others are estimating time only. I had some experience already ...


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -