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

关于若干请求后,内存溢出问题 #46

Closed
xiaosanye opened this issue Sep 10, 2018 · 5 comments
Closed

关于若干请求后,内存溢出问题 #46

xiaosanye opened this issue Sep 10, 2018 · 5 comments

Comments

@xiaosanye
Copy link

因为PHP无法常驻内存,所有每个对象都是page Scope的,用户每次的请求都会重新初始化一遍jieba-php的服务,现在遇到缓存无法释放,执行若干次后,内存溢出,请问你们是怎么处理的

@xiaosanye
Copy link
Author

@fukuball

@fukuball
Copy link
Owner

通常斷詞這樣的處理都會是離線處理的,目前 jieba-php 佔用的內存較大,也因此不太會直接在網頁上初始化 jieba-php,如果非得在網頁上使用,可以在每次使用後將物件刪除(將物件設為 null 再 unset)以釋放 memory,不過如果多人同時使用還是會爆,還是想辦法離線處理較好。

jieba-php 佔用較大的內存需要花時間解決,我再花一些時間來研究看看好了

@fukuball
Copy link
Owner

#49

@xiaosanye
Copy link
Author

谢谢了,我也研究一下

@fukuball
Copy link
Owner

已在 master 改善這問題囉

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

No branches or pull requests

2 participants