domenica, gennaio 15, 2012

Android gallery hangs when showing thumbnails

[A post of mine on xda-developers]
When I open Gallery my Defy hangs. 
Looking CPU usage (via ADB) I see that the gallery process takes almost all the CPU.
Below a workaround for this problem.
Connect your device with adb (I use adb over wifi) and verify that your CPU is normal.

Code:
adb connect 192.168.0.3:8000
adb shell
top
The "top" command prints cpu usage every 5 seconds or so.
Scroll up and take a look at the first line.

You should read low values for User and System % (mine is "User 0%, System 5%")
Start gallery on your device, now you should see the cpu usage very high, say over 90% for user.
The first process listed is the one hogging your cpu.
   
Code:
User 93%, System 5%, IOW 0%, IRQ 0%
User 292 + Nice 0 + Sys 16 + Idle 0 + IOW 0 + IRQ 3 + SIRQ 0 = 311

  PID CPU% S  #THR     VSS     RSS PCY UID      Name
 5243  93% S    12 122920K  31264K  fg app_209  com.littlefatfish.photo
The name of the process could vary (say com.cooliris.media).
Write down the PID (in this case 5243).
Hit CTRL+C, adb exit.
Launch adb and take a look at the files held by this process, issuing 
   
Code:
adb shell
ls -l /proc/5243/fd
In the list you should see only one media file, the one that is blocking the gallery!!!
In my case it was 
/mnt/sdcard/DoveConviene_icons/segnalino_ld-market@2x.png

Now you have to remove this file (if is important for you, you should copy elsewhere).

rm /mnt/sdcard/DoveConviene_icons/segnalino_ld-market@2x.png

My gallery now it's back to normality!!!!! (at least 'till another png will block it)

Nessun commento: