致命错误:分配较少时,PHP中允许的内存大小 [英] Fatal error: Allowed memory size in PHP when allocating less

查看:113
本文介绍了致命错误:分配较少时,PHP中允许的内存大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个:

严重错误:耗尽的268435456字节的允许内存大小(尝试 分配4981690字节)在...中

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4981690 bytes) in...

这似乎有点奇怪!据我所知,这不应该发生吗?并非意味着相反.我已经在使用一个非常大的memory_limit

That seems a bit odd! From what I can read, it shouldn't happen should it? Isn't meant' to be the other way around. I'm already using a stupidly large memory_limit

推荐答案

它不会尝试一次分配所有内容.假设我们的限制是10个字节.它将分配3、3、3和另外3个-繁荣:抛出错误:

It doesn't attempt to allocate it all at once. Let's say our limit is 10 bytes. It will allocate 3, 3, 3 and another 3 - boom: throws the error:

Allowed memory size of 10 bytes exhausted (tried to allocate 3 bytes) in..

这篇关于致命错误:分配较少时,PHP中允许的内存大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆