api - Long running PHP script using up server memory -


bit of odd one. i've got laravel 5 project pulls data api , stores in local database. third party api uses xml - pull data using guzzle , parse using simplexml objects.

i trying track down appears memory leak in project. if script left running long enough (and have - first sync of data take day or two) consumes memory on, , crashes, server.

this confusing bit - i've run app in debug mode , made output memory_get_usage() periodically , stop after given number of requests. php not report sharp increase. start finish total memory usage reported way increases 10kb. if watch process in activity monitor on dev machine (a mac), goes 20mb 30mb. left copy of full script running overnight other day , when checked in morning claimed have used 750mb.

the same thing happens on amazon ec2 instance script it's thing live. memory_get_usage() doesn't report unusual - leave script running and, in top, sit @ top of process list , mem% gradually increase until... bang. i've got copy running right - started @ 7% , sat on 37.4%, amount of "free" memory isn't decreasing. it's using buffers, think.

so how track down apparent memory leak when php doesn't believe it's got one?


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -