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

内存泄漏问题 #112

Open
liu86th opened this issue Jan 10, 2024 · 2 comments
Open

内存泄漏问题 #112

liu86th opened this issue Jan 10, 2024 · 2 comments

Comments

@liu86th
Copy link

liu86th commented Jan 10, 2024

1
运行一段时间自动崩了,去掉x.Free() 这个就不会崩,但是内存占用好大啊,部署到k8s中去的时候
bug

@CNLHC
Copy link

CNLHC commented Mar 24, 2024

I guess that the problem here is that you are trying to invoke x.Free() manually.

Actually, I add this line in order to make the golang GC to manage the underlying jieba memory which i consider the right way to write go program. #96

A quick fix is removing your manual invokation to the Free method and let the FInalizer do the free job.

My personal opinion is that the Free method should be private here. Because if gojieba keeps the Free method and rely on the user to manage the jieba memory, all the go objects that contain (directly or indirectly) the jieba instance will rely on the user to manage memory, which is not an ideal go pattern.

@mostcute
Copy link

double free or corruption (!prev)

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

3 participants