php cli 内存不释放,PHP CLI脚本如何确定其内存限制?(How else might a PHP CLI script determine its memory limit?)...

I need to run a PHP CLI script and give it a LOT of memory (it's an automatic documentation generator that needs to cover a large code base). I have a powerful machine and have allocated 5GB to php, both in php.ini and in an inline ini_set('memory_limit','5120M') declaration in the script file.

If I add these lines to top of the script:

phpinfo();

exit();

... it claims that it has a memory limit of 5120M, as I specified.

But the script still errors out, saying

Fatal error: Allowed memory size of 1073741824 bytes exhausted

... which is 1GB, not 5GB as I specified.

Is there any other place that the script might be looking to determine its memory limit? This is running in Fedora Linux.

(Yes, the ultimate solution may be to rewrite the script to be more efficient, but I didn't write it in the first place, so before I resort to that, I want to just throw resources at it and see if that works.)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值