KwaiAppTeam / KOOM

KOOM is an OOM killer on mobile platform by Kwai.
Other
3.2k stars 426 forks source link

启动IntentService进行hprof数据分析时报配置未初始化 #253

Open sunwensheng opened 1 year ago

sunwensheng commented 1 year ago

FATAL EXCEPTION: IntentService[HeapAnalysisService] Process: com.okinc.okex.gp:heap_analysis, PID: 23357 kotlin.UninitializedPropertyAccessException: lateinit property commonConfig has not been initialized at com.kwai.koom.base.MonitorManager.getCommonConfig$koom_monitor_base_SharedCppRelease(MonitorManager.kt:33) at com.kwai.koom.base.MonitorBuildConfig$VERSION_NAME$2.invoke(MonitorBuildConfig.kt:29) at com.kwai.koom.base.MonitorBuildConfig$VERSION_NAME$2.invoke(MonitorBuildConfig.kt:23) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at com.kwai.koom.base.MonitorBuildConfig.getVERSION_NAME(Unknown Source:2) at com.kwai.koom.javaoom.monitor.OOMFileManager.init(OOMFileManager.kt:65) at com.kwai.koom.javaoom.monitor.analysis.HeapAnalysisService.onHandleIntent(HeapAnalysisService.kt:190) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78) at android.os.Handler.dispatchMessage(Handler.java:110) t android.os.Looper.loop(Looper.java:219) at android.os.HandlerThread.run(HandlerThread.java:67)

正常进行初始化。KOOM也能正常的在达到阈值时抓取内存,但是在针对hprof进行内存分析启动IntentService时报上述的配置未初始化。debug都是能看到数据的。是因为多进程的问题?

AndroidInternal commented 6 months ago

是的

Xinmeng322 commented 6 months ago

你的邮件已收到。

cso1z commented 6 months ago

留意MonitorManager.initCommonConfig(config)初始化代码 是否在Application每次onCreate()时都能执行