These are results of 'top' running the (unmodified) CameraPreview of the 
ApiDemos sample on two Nexus S devices, one with Gingerbread, the other one 
with Ice Cream Sandwich:

1) Nexus S, Gingerbread, Build Target: Android 2.3.3
User 1%, System 6%, IOW 0%, IRQ 0%
User 6 + Nice 0 + Sys 21 + Idle 282 + IOW 0 + IRQ 0 + SIRQ 0 = 309

  PID   TID CPU% S     VSS     RSS PCY UID      Thread          Proc
 1138  1138   3% R   1092K    528K  fg shell    top             top
   75  1142   1% D  32312K   4500K  fg media    CameraPreviewTh 
/system/bin/mediaserver
  114   125   0% D 192872K  62016K  fg system   system_server   
system_server
  182   182   0% S 103024K  27104K  fg system   ndroid.systemui 
com.android.systemui
  114   126   0% S 192872K  62016K  fg system   SensorService   
system_server

2) Nexus S, ICS, Build Target: Android 2.3.3
User 28%, System 21%, IOW 0%, IRQ 0%
User 90 + Nice 0 + Sys 69 + Idle 157 + IOW 0 + IRQ 0 + SIRQ 1 = 317

  PID   TID PR CPU% S     VSS     RSS PCY UID      Thread          Proc
   81  2509  0  17% S  49372K   5100K  fg media    CameraPreviewTh 
/system/bin/mediaserver
   78   131  0  15% S  39576K  17648K  fg system   SurfaceFlinger  
/system/bin/surfaceflinger
  162   175  0   4% D 356748K  46212K  fg system   system_server   
system_server
 2478  2478  0   3% R   1188K    588K  fg shell    top             top
  162   177  0   1% S 356748K  46212K  fg system   er.ServerThread 
system_server

3) Nexus S, ICS, Build Target: Android 4.0.3
User 44%, System 15%, IOW 0%, IRQ 0%
User 140 + Nice 0 + Sys 50 + Idle 128 + IOW 0 + IRQ 0 + SIRQ 0 = 318

  PID   TID PR CPU% S     VSS     RSS PCY UID      Thread          Proc
   81  2931  0  38% S  55904K   8412K  fg media    CameraPreviewTh 
/system/bin/mediaserver
   78   131  0   7% S  45432K  22484K  fg system   SurfaceFlinger  
/system/bin/surfaceflinger
 2921  2921  0   3% R   1188K    588K  fg shell    top             top
  162   175  0   2% D 356860K  47052K  fg system   system_server   
system_server
 2718  2718  0   1% S      0K      0K  fg root     kworker/0:1 

Indeed, one does not even need to perform any additional (native) 
processing to find that the mediaserver and surfaceflinger processes are 
consuming an unhealthy amount of CPU power on Ice Cream Sandwich. Note that 
the exact behavior even changes with different build targets; ~30% of CPU 
time are already bad when building against Android 2.3.3, but it gets a lot 
worse with ~45% when building against Android 4.0.3. Am planning to file a 
bug report.


On Thursday, March 1, 2012 6:53:08 PM UTC+1, Chris Stratton wrote:
>
>
> On Thursday, March 1, 2012 12:08:31 PM UTC-5, Michael wrote:
>>
>> Good tip! This is a print from top running the test application on a 
>> Nexus S with Gingerbread:
>>
>> User 89%, System 3%, IOW 0%, IRQ 0%
>> User 282 + Nice 0 + Sys 12 + Idle 22 + IOW 0 + IRQ 0 + SIRQ 0 = 316
>>   PID   TID CPU% S     VSS     RSS PCY UID      Thread          Proc
>>   771   771  86% R 104220K  27216K  fg app_54   PerformanceTest 
>> com.ICSPerformanceTest
>>
>  
>
>> And this is the exact same application on a Nexus S with Ice Cream 
>> Sandwich:
>>
>> User 87%, System 9%, IOW 0%, IRQ 0%
>> User 287 + Nice 0 + Sys 32 + Idle 9 + IOW 0 + IRQ 0 + SIRQ 0 = 328
>>   PID   TID PR CPU% S     VSS     RSS PCY UID      Thread          Proc
>>  2849  2849  0  57% R 278568K  35372K  fg app_66   PerformanceTest 
>> com.ICSPerformanceTest
>>    81  2867  0  28% S  56408K   9196K  fg media    CameraPreviewTh 
>> /system/bin/mediaserver
>>
>  
>
>> We still don't know why this is happening, though. It's not an active 
>> face detection - we double-checked that. A quick look through the Android 
>> source code didn't give any insight either. Though my suspicion is that 
>> either something is wrong with the ICS implementation or the camera driver. 
>> It would be nice to get more info on that, and potential solutions to fix 
>> the issue.
>>
>
> You could try and see if you can get git to give up a diff of the relevant 
> files in mediaserver between the two versions of Android, but that may be a 
> lengthy path to follow.
>
> It would be interesting if you could reproduce the same difference in 
> mediaserver CPU usage with someone else's code that doesn't do any (even 
> dummy) native processing.  Could you try the CamerPreview in the ApiDemos 
> of the sdk samples?   If you can reproduce the mediaserver CPU load 
> reflected by top with that you'd clearly be in a position to file a bug 
> report.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to