-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add a fast dumper with HeapDumper API. #2387
Comments
Very cool! Now we need to move this to the docs. |
Could you please tell me what is the next plan for this? |
The plan is to add it to the doc, when myself or someone else gets to it :) |
Looking forward to it, please let me know when it has been done, thanks :) |
I tried to do this, but it didn't solve my problem version: |
Please describe the problem you encountered in detail and attach the logcat, thanks |
It may be a conflict of STL versions. You can try If it still doesn't work, please dump logcat with 16743 16766 I OOMMonitor_ForkJvmHeapDumper: dump xxx.hprof.
16743 16766 I OOMMonitor_ForkJvmHeapDumper: before suspend and fork.
// The pid changes from 16743 to 16807, and the child process starts to dump
16807 16807 I mple.leakcanar: hprof: heap dump "xxx.hprof" starting...
// The child process dump finished, it takes 6.4s
16807 16807 I mple.leakcanar: hprof: heap dump completed (24MB) in 6.411s objects 330914 objects with stack traces 0
16807 16807 I JNIBridge: process 16807 will exit!
// The main process is notified by the completion of the child process dump
16743 16766 I OOMMonitor_ForkJvmHeapDumper: dump true, notify from pid 16807 |
2023-02-24 14:14:50.913 18972-20809/com.bstar.intl.pogo D/LeakCanary:
|
The hprof file has been successfully dumped, which means that it is not a problem in the dump stage, but a problem in leak analysis. The main function of koom is to improve the performance of hprof dump and avoid lagging during dump. |
This is just a case of a heap dump with no leaks in it. The user is forcing heap dumps and surprised no leaks are found. |
debugImplementation leakcanary, but this code can not compile in. release mode |
Encapsulate the relevant code into a sub-library, and then use debugImplementation. |
Our sdk version as follows: and the koom version: 2.2.0 When encounter leaking, the logcat print as below: Does anybody knows what make a dump false? |
Fast dump
@pyricau As we discussed in #2047 & #2121, I add a fast dumper with HeapDumper API #2237 in KOOM v2.2.0.
How to use it
dependencies { implementation "com.kuaishou.koom:koom-fast-dump:2.2.0" }
Additional information
The minSdkVersion of fast dump is 18. If the minSdkVersion of your app is lower than that, it needs to be compatible with overrideLibrary in the manifest.
Fast dump support both shared and static libc++, if you are worried about STL conflicts, please use the static version, or you will prefer to the shared version for package size.
Please check logcat prefix with OOMMonitor to see if fast dump works.
The text was updated successfully, but these errors were encountered: