致命错误:允许的内存大小为134217728用完的字节数(CodeIgniter + XML-RPC) [英] Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)

查看:1410
本文介绍了致命错误:允许的内存大小为134217728用完的字节数(CodeIgniter + XML-RPC)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆客户销售点(POS)系统,定期将新的销售数据发送到一个集中的数据库,将数据存储在一个大数据库中生成报告。

I have a bunch of client point of sale (POS) systems that periodically send new sales data to one centralized database, which stores the data into one big database for report generation.

客户端POS基于PHPPOS,我实现了一个使用标准XML-RPC库将模块发送到服务的销售数据。服务器系统构建于CodeIgniter上,并为Web服务组件使用XML-RPC和XML-RPCS库。每当我发送大量销售数据(从销售表中只有50行,以及来自sales_item的单独行与销售中的每个项目有关),我会收到以下错误:

The client POS is based on PHPPOS, and I have implemented a module that uses the standard XML-RPC library to send sales data to the service. The server system is built on CodeIgniter, and uses the XML-RPC and XML-RPCS libraries for the webservice component. Whenever I send a lot of sales data (as little as 50 rows from the sales table, and individual rows from sales_items pertaining to each item within the sale) I get the following error:

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

128M是 php.ini 中的默认值,但我认为这是一个巨大的数字。事实上,我甚至尝试将此值设置为1024M,并且它所做的是花费更长的时间来错误输出。

128M is the default value in php.ini, but I assume that is a huge number to break. In fact, I have even tried setting this value to 1024M, and all it does is take a longer time to error out.

至于我采取的步骤,我我们已经尝试禁用服务器端的所有处理,并且绑定它返回一个罐头响应,而不管输入。然而,我相信问题在于实际发送的数据。我甚至尝试禁用PHP的最大脚本执行时间,它仍然是错误出来。非常感谢您的帮助!

As for steps I've taken, I've tried disabling all processing on the server-side, and have rigged it to return a canned response regardless of the input. However, I believe the problem lies in the actual sending of the data. I've even tried disabling the maximum script execution time for PHP, and it still errors out. Thank you so much for your help!

推荐答案

人们,改变memory_limit由 ini_set('memory_limit' ,'-1'); 一个解决方案。

People, changing the memory_limit by ini_set('memory_limit', '-1'); is NOT a solution at all.

请不要这样做。显然php在某处有一个内存泄漏,你告诉服务器只使用它想要的所有内存。这个问题根本没有解决。如果你监视你的服务器,你会看到它现在可能已用尽了大部分的RAM,甚至交换到磁盘。

Please don't do that. Obviously php has a memory leak somewhere and you are telling the server to just use all the memory that it wants. The problem has not been fixed at all. If you monitor your server, you will see that it is now probably using up most of the RAM and even swapping to disk.

你应该尽量跟踪错误代码并修复它。

You should probably try to track down the exact bug in your code and fix it.

这篇关于致命错误:允许的内存大小为134217728用完的字节数(CodeIgniter + XML-RPC)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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