Gratzi
Gratzi

Reputation: 4693

Cannot use the dump HPROF file function

I want to track the memory leaks of my application. But when I want to press the dump HPROF file button from the DDMS, I get an error message saying that: "hprof: can't open /sdcard/com.google.android.apps.uploader.hprof-hptemp: Permission denied." How can I fix this?

Upvotes: 5

Views: 3359

Answers (3)

FoxMulder900
FoxMulder900

Reputation: 1291

If you are using an emulator, you also need to be sure that your virtual device has an SD Card configured. Just open up the Android Virtual Device Manager, select your AVD and click "Edit...". Then just make sure you have a size entered for your virtual SD card.

Upvotes: 1

emmby
emmby

Reputation: 100464

DKIT absolutely has the right answer. However, if you follow that suggestion and still have problems, make sure that your SD card is not mounted on your PC while plugged in over USB. If your SD card is mounted, your process won't be able to gain write access to the card to dump the hprof.

Upvotes: 2

DKIT
DKIT

Reputation: 3481

Yes.

Connect to your emulator/device using ADB.

Then make the catalog world writable, using chmod 777

You can also add the permission WRITE_EXTERNAL_STORAGE to your manifest file.

Read the instructions here: http://www.netmite.com/android/mydroid/2.0/dalvik/docs/heap-profiling.html

Upvotes: 7

Related Questions