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

plugin卸載時無法將已經加載的字節從内容中回收掉 #433

Open
Fnck opened this issue Apr 23, 2019 · 0 comments
Open

plugin卸載時無法將已經加載的字節從内容中回收掉 #433

Fnck opened this issue Apr 23, 2019 · 0 comments

Comments

@Fnck
Copy link

Fnck commented Apr 23, 2019

看了下源碼,
com.github.ltsopensource.tasktracker.runner.plug.PlugManager#unstall
這個方法只是將新增的classloader中對jar包的句柄關閉,因此可以將jar刪除,但是已加載的字節無法壓縮,由於parent\sub classloader的關係存在,gc也無法回收這部分代碼,會造成memory leak
建議
將sub classloader的parent字段用反射方式置爲null,下次gc會回收掉

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

1 participant