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

Implement fast dump #2047

Closed
pyricau opened this issue Jan 1, 2021 · 3 comments
Closed

Implement fast dump #2047

pyricau opened this issue Jan 1, 2021 · 3 comments

Comments

@pyricau
Copy link
Member

pyricau commented Jan 1, 2021

Today, heap dump is slow and blocks the VM. https://github.com/KwaiAppTeam/KOOM showed that it can be done as fork and dump for a number of archectures, which is much faster.

Proposal: create a new set of modules for heap dumping. That way we separate the default android impl, the native fast impl amd the jvm impl. These modules should stand on their own, e.g. if someone just wants heap dumping.

The native libs for fast dump should probably not be included for a few default for a few releases. Some people want to keep binary size small.

alhah added a commit to alhah/leakcanary that referenced this issue May 5, 2021
All you need to do is to add the dependency of ‘fast-dump’, 'DumpWrapper' will automatically do the rest.
Support Android 5~11.

Signed-off-by: xueqiushi <xueqiushi@kuaishou.com>
alhah added a commit to alhah/leakcanary that referenced this issue May 5, 2021
All you need to do is to add the dependency of ‘fast-dump’, 'DumpWrapper' will automatically do the rest.
Support Android 5~11.

Signed-off-by: xueqiushi <xueqiushi@kuaishou.com>
@alhah
Copy link

alhah commented May 5, 2021

Sorry for the late submission. Recently, we are busy with Spring Festival activities. Every Chinese Internet company is the busiest during the months around the Spring Festival. Later, I discussed with the company's legal team to obtain permission to release the code.

Please help to review my code

When dumping hprof with DumpWrapper, judge whether there is a fast-dump module through reflection, if it exists, call the JNI method, if it does not exist, follow the original logic

alhah added a commit to alhah/leakcanary that referenced this issue May 5, 2021
All you need to do is to add the dependency of ‘fast-dump’, 'DumpWrapper' will automatically do the rest.
Support Android 5~11.

Signed-off-by: xueqiushi <xueqiushi@kuaishou.com>
@pyricau
Copy link
Member Author

pyricau commented May 11, 2021

Cool!

Can you open up a pull request against this repository? Then I can review and leave comments there (it's important to ensure proper CLA signing)

Oops I didn't realized that was done here: #2121

@pyricau
Copy link
Member Author

pyricau commented Apr 15, 2022

This will be released as part of KOOM now that the API is pluggable. #2121 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants