Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

超出内存限制 #60

Open
linhongzhao321 opened this issue Oct 8, 2019 · 4 comments
Open

超出内存限制 #60

linhongzhao321 opened this issue Oct 8, 2019 · 4 comments
Labels

Comments

@linhongzhao321
Copy link

场景
默认精确度,初始化完成后,在swoole协程中循环运行。大概执行 1W+ 次分词后,会报超出内存限制,从报错前一刻最后一个数据开始重新执行分词任务,又会继续正常运行,但执行1W+次分词后又会再次出现。
PHP Fatal error: Allowed memory size of 335544320 bytes exhausted (tried to allocate 1179648 bytes) in /<隐藏路径>/vendor/fukuball/jieba-php/src/vendor/multi-array/MultiArray.php on line 121

疑问
请问有什么原因吗?或者是我需要提供更具体的信息?

@linhongzhao321
Copy link
Author

swoole协程是单线程模型,我想这个问题应该与是否在协程中执行无关

@linhongzhao321
Copy link
Author

改用small dict后问题解决,但不明白问题原因

@linhongzhao321
Copy link
Author

使用small,运行分析100W+次分析,依然超出内存,并不能根本解决问题

@fukuball
Copy link
Owner

@linhongzhao321 這樣看起來似乎是字典不斷在過程中被擴充,可以檢查一下使用方式為何會讓字典不斷擴大(比如印出 Array 的大小,基本上過程中不應該不斷擴大的)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants