easy-swoole / easyswoole

swoole,easyswoole,swoole framework
https://www.easyswoole.com/
Apache License 2.0
4.73k stars 512 forks source link

内存table 问题(框架Core.php文件) #559

Closed migrant-work closed 3 months ago

migrant-work commented 1 year ago

[2022-08-18 15:22:17][trigger][warning]:[Swoole\Table::set(): failed to set('9205'), unable to allocate memory at file:/home/share/v3.api.easyswole/vendor/easyswoole/easyswoole/src/Core.php line:302]

XueSiLf commented 1 year ago

请提供下您的php版本和swoole版本,方便我们这边复现。

ld0574 commented 1 year ago

php 8.2.0 swoole4.8.12 报错: [2023-01-23 16:25:59][trigger][warning]:[Swoole\Table::set(): failed to set('52504'), unable to allocate memory at file:/vendor/easyswoole/component/src/Process/AbstractProcess.php line:91] 看了文档后 https://wiki.swoole.com/#/memory/table?id=__construct 调整/vendor/easyswoole/component/src/Process/Manager.php的 $this->table = new Table(204800); 就正常了

XueSiLf commented 3 months ago

php 8.2.0 swoole4.8.12 报错: [2023-01-23 16:25:59][trigger][warning]:[Swoole\Table::set(): failed to set('52504'), unable to allocate memory at file:/vendor/easyswoole/component/src/Process/AbstractProcess.php line:91] 看了文档后 https://wiki.swoole.com/#/memory/table?id=__construct 调整/vendor/easyswoole/component/src/Process/Manager.php的 $this->table = new Table(204800); 就正常了

这个是因为你自定义进程里有异常未捕获导致的。建议加上try-catch捕获异常。