PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312)_Android, Python及开发编程讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Android, Python及开发编程讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 1924 | 回复: 0   主题: PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312)        下一篇 
yanpeng
注册用户
等级:上等兵
经验:127
发帖:68
精华:0
注册:2011-12-26
状态:离线
发送短消息息给yanpeng 加好友    发送短消息息给yanpeng 发消息
发表于: IP:您无权察看 2015-4-22 9:00:12 | [全部帖] [楼主帖] 楼主

Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744


疑问:786432 是指786432bytes?即:768MB 98304 bytes=96MB 那0.75M是怎么算出来的。
正确答案:786432bytes=768KB=0.75MB 98304bytes=96KB=0.09MB ?
最小是位 <其次字节(byte)<KB<MB<GB<TB
一个字节 =8位

 1KB=1024B(字节)
1MB=1024KB
1GB=1024MB
1TB=1024GB


千,1KB=2的10次方=1024B,
兆,1MB=2的20次方=1024*1024B=1024KB,
吉,1GB=2的30次方=1024*1024*1024B=1024MB,
太,1TB=2的40次方=1024*1024*1024*1024B=1024GB,
拍,1PB=2的50次方=1024*1024*1024*1024*1024B=1024TB,
艾,1EB=2的60次方=1024*1024*1024*1024*1024*1024B=1024PB,
泽,1ZB=2的70次方=1024*1024*1024*1024*1024*1024*1024B=1024EB,
尧,1YB=2的80次方=1024*1024*1024*1024*1024*1024*1024*1024B=1024ZB.

今天一个客户的网站出现这样的错误。程序是PHP的。经百度了一下。说明内存不足。中文件翻译的意思是:内存不足(分配786432)(尝试分配98304字节)意思是尝试分配98MB的内存。但一般php设置为只允许给php程序分配 0.75M内存
解决办法:打开php.ini 修改memory_limit = 的这行
依照服务器配置进行调整
配置的内存使用大小修改后重启iis/apache
问题解决^^

PHP5.2.3-win32这个版本有个非常严重的bug,那就是最大内存设置成1024M,但是PHP实际返回的只有2M,经常返回下面的错误:

 PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 786432) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 393216 bytes)


这是官方的bug报告,该bug只出现于windows版本,linux版本没有这个bug。看来只能等下一次升级的时候修复了。

--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论