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

LeakedClosableObjects(资源对象正确关闭)问题 #32

Closed
huannan opened this issue Sep 29, 2020 · 1 comment
Closed

LeakedClosableObjects(资源对象正确关闭)问题 #32

huannan opened this issue Sep 29, 2020 · 1 comment

Comments

@huannan
Copy link

huannan commented Sep 29, 2020

报告一个今天自动化测试工具跑出来的LeakedClosableObjects(资源对象正确关闭)问题

Process: com.flyme.videoclips:heap_analysis PID: 21396 Flags: 0x38883e44 Package: com.flyme.videoclips v2014000 (2.14.0) Build: Meizu/meizu_16X_CN/16X:8.1.0/OPM1.171019.026/1572938190:user/release-keys System-App: false Uptime-Millis: 1632973 java.lang.Throwable: Explicit termination method 'close' not called at dalvik.system.CloseGuard.open(CloseGuard.java:223) at java.io.FileInputStream.<init>(FileInputStream.java:156) at kshark.Hprof$Companion.open(SourceFile:71) at com.kwai.koom.javaoom.analysis.SuspicionLeaksFinder.buildIndex(SourceFile:194) at com.kwai.koom.javaoom.analysis.SuspicionLeaksFinder.find(SourceFile:88) at com.kwai.koom.javaoom.analysis.KHeapAnalyzer.analyze(SourceFile:44) at com.kwai.koom.javaoom.analysis.HeapAnalyzeService.doAnalyze(SourceFile:113) at com.kwai.koom.javaoom.analysis.HeapAnalyzeService.onHandleIntent(SourceFile:85) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:192) at android.os.HandlerThread.run(HandlerThread.java:65) A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.

@AndroidInternal
Copy link
Contributor

只会打开一次,进程退出后回收,先忽略吧。或者改下shark的逻辑在分析完成后再执行close。

后面会写一个新的c++版hprof parser换掉shark。

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