本文介绍了php内存限制2000M耗尽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!


From the looks of it, I'm assuming you're using simplexml to load the data. SimpleXML is a memory overkill and it can't be used for large files without exactly this happening. You should instead try using:


  1. 基于(比第二个更少的内存使用,但更难操作)

  2. pull基于

  1. event based SAX parser (less memory usage than the 2nd one, but much harder to operate)
  2. pull based XMLReader

FYI,我已经使用SAX加载大约200MB XML文件,峰值内存使用大约5MB,所以是的,内存消耗是无法比较的。

FYI, I've been using SAX to load about 200MB XML file with peak memory usage about 5MB, so yes, the memory consumption is uncomparable.

这篇关于php内存限制2000M耗尽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 07:34
查看更多