I'm mining some data from Yahoo RSS, but it seems to be making a memory leak? It's quite bazaar. I data mine multiple sources with the same code, but Yahoo RSS feed is the only one that overloads the memory. This is a dumbed down version of the code but basically if you run this in multiple instances, it'll crash the server eventually because it'll run out of memory:
while(1) {
$get_rss = file_get_contents("https://feeds.finance.yahoo.com/rss/2.0/headline?s=AAPL®ion=US&lang=en-US");
}
However, if you run this same code with a different source, it runs absolutely fine and stable, such as:
while(1) {
$get_rss = file_get_contents("http://www.marketwatch.com/news/headline/getheadlines?ticker=AAPL&countryCode=US&dateTime=&docId=&docType=2007&sequence=bb90b87a-9f6f-4d70-9a1d-b052088523f5&messageNumber=0&count=10&channelName=%2Fnews%2Fpressrelease%2Fcompany%2Fus%2Faapl&topic=&_=1460832767208");
}
Can anyone explain this behavior to me? I find it quite bazaar/weird. I usually use a curl method for pulling the URL contents, but switched to this file_get_contents to see if it acted the same, and it does. I've tried simple xml, it also has the same behavior. I don't understand?
Do RSS files get cached into memory? I don't see how/why that would happen. Any help / knowledge about this issue would be appreciated