简体   繁体   English

内存耗尽的php,这是否由于1个文件而发生,还是有可能因为我同时运行多个文件而发生?

[英]memory exhausted php, does this happen because of 1 file or is it possible it happens because i run multiple files at the same time?

I've made a CSV parser but sometimes it returns a memory exhausted error. 我做了一个CSV解析器,但有时它返回内存耗尽错误。 The CSVparser consists of a jquery loop that starts multiple php files with ajax to parse a file. CSVparser由一个jquery循环组成,该循环使用ajax启动多个php文件来解析一个文件。 Some of the files return the error and i was wondering if this has something to do with the files running at the same time. 一些文件返回错误,我想知道这是否与同时运行的文件有关。 So my question is, can i prevent the exhausting error by queuing up the parsing? 所以我的问题是,我可以通过排队来防止耗尽错误吗?

If you're receiving the PHP error Fatal error: Allowed memory size of ### bytes exhausted then that means the single thread ran out of memory - regardless of any other processes. 如果收到PHP错误Fatal error: Allowed memory size of ### bytes exhausted则意味着单线程用完了内存-不管其他进程如何。 The memory you set for PHP ( memory_limit ) isn't divided amongst the running processes or anything like that. 您为PHP设置的内存( memory_limit )不分配给正在运行的进程或类似的进程。 That amount is reserved for each instance. 该金额将为每个实例保留。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM