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

Unable to share Heap Dump #21

Closed
andhie opened this issue May 10, 2015 · 7 comments · Fixed by #27
Closed

Unable to share Heap Dump #21

andhie opened this issue May 10, 2015 · 7 comments · Fixed by #27

Comments

@andhie
Copy link

andhie commented May 10, 2015

  1. Install the sample application
  2. Cause a memory leak as per instruction
  3. View the Leak report and Share Heap Dump
  4. Choose any 3rd Party app such as Gmail; Gmail will toast Permission denied for the attachment
@pepyakin
Copy link

That is what I talked about in #4.

@pyricau
Copy link
Member

pyricau commented May 10, 2015

thx. Any specific device?

@andhie
Copy link
Author

andhie commented May 10, 2015

I would say probably majority or all devices are affected.
I've tested on LG G3 stock 5.0, Galaxy S2 stock 4.1, and also Genymotion 5.0.

@pyricau
Copy link
Member

pyricau commented May 10, 2015

Confirmed. It used to work.

@pyricau
Copy link
Member

pyricau commented May 10, 2015

One option here could be to move the heapdumps to the SD card. That means we'd need the sd card permission. I think it's ok since this is a dev tool. The other advantage is that the space used would be the sdcard space, so it wouldn't show up in the app size.

@pepyakin
Copy link

👍 for SD card.

pyricau added a commit that referenced this issue May 10, 2015
* Heap dumps and analysis results were previously saved in the app directory. They are now saved on the external storage (sd card).
* Centralized internal static helper methods to a dedicated class: `LeakCanaryInternals`.

BREAKING CHANGES

* When upgrading, previously saved heap dumps will be lost, but won't be removed from the app directory. You should probably uninstall your app.
* Added permission WRITE_EXTERNAL_STORAGE
* Public API change: Removed `Application` parameter in `LeakCanary.androidWatcher()`
* Public API change: Removed `Application` parameter in `AndroidHeapDumper()`

* Fixes #21 (can't share heap dump)
* This is a step towards fixing #15 (strict mode violations), although there's still more work.
@andhie
Copy link
Author

andhie commented May 27, 2015

Due to the changes to move every heap dump to /sdcard/Download/leakcanary/detected_leaks, when you have multiple LeakCanary enabled version of different apps, LeakCanary cannot differentiate whose heap dump belongs to which app and will just happily list out all. And also due to the limited of number of dumps, other apps that has leaks could not dump due to the shared location.

Proposed changes

  1. Use /sdcard/Android/data/<packagename>
  2. Maintain /Downloads dir, but add another packagename folder

Yky pushed a commit to Yky/leakcanary that referenced this issue Feb 21, 2016
* Heap dumps and analysis results were previously saved in the app directory. They are now saved on the external storage (sd card).
* Centralized internal static helper methods to a dedicated class: `LeakCanaryInternals`.

BREAKING CHANGES

* When upgrading, previously saved heap dumps will be lost, but won't be removed from the app directory. You should probably uninstall your app.
* Added permission WRITE_EXTERNAL_STORAGE
* Public API change: Removed `Application` parameter in `LeakCanary.androidWatcher()`
* Public API change: Removed `Application` parameter in `AndroidHeapDumper()`

* Fixes square#21 (can't share heap dump)
* This is a step towards fixing square#15 (strict mode violations), although there's still more work.
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

Successfully merging a pull request may close this issue.

3 participants