致命错误:耗尽了134217728字节的允许的内存大小(试图分配71个字节) [英] Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes)

查看:349
本文介绍了致命错误:耗尽了134217728字节的允许的内存大小(试图分配71个字节)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
允许的内存大小为33554432字节已耗尽(试图在php中分配43148176字节)

Possible Duplicate:
Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

在我的php页面中,出现如下错误,

In my php page, I got the error as follows,

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) 

我尝试使用ini_set('memory_limit', '128M');

但还是我得到了错误.

任何帮助将不胜感激.

推荐答案

128兆字节 134,217,728字节.您已经用完了该内存.您要么需要设置上限 (如果可以,我不知道PHP是否允许这样做),或者只是在代码中使用更少的内存即可.

128 megabytes is 134,217,728 bytes. You've used up that memory. You either need to set the limit higher (if you can; I don't know if PHP will allow that) or simply use less memory in your code.

您是否希望页面使用大量内存?如果是这样,那么提高限制(或将其设置为-1,这在允许无限使用内存方面就有些危险了)是正确的选择.如果不是这样,请遍历代码以查找可能有效泄漏内存的地方.您可能希望尝试一次用虚拟"块替换页面的各个部分,直到找到有问题的部分.

Do you expect your page to be using a lot of memory? If so, maybe raising the limit (or setting it to -1, which is somewhat dangerous in terms of allowing unlimited memory use) is the right thing to do. If not, look through your code for places where you could be effectively leaking memory. You might want to try replacing sections of your page with "dummy" blocks, one at a time, until you find the offending section.

这篇关于致命错误:耗尽了134217728字节的允许的内存大小(试图分配71个字节)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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