energy in mobile - university college londoncrest.cs.ucl.ac.uk/cow/50/slides/cow50_rubin.pdf · in...

Post on 16-Feb-2018

213 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Energy-Efficiency in Mobile Software

JuliaRubin(jointlywithDulingLai,JürgenCito,PhillipStanley-Marbell)

January31,2017

Mobile Applications

•  Morethan2billionsmartphonesinuse–  Morethandesktopcomputers–  Plussmartwatches,glasses,cameras,TVs,in-carnaviga=on,andmessaging

•  Morethan3millionmobileappsinofficialappstores–  …andmuchmoreappsinhundredsofalterna=vestores

•  ~2.3millionac=vemobiledevelopersworldwide–  760,000peopleinAsia–  680,000peopleinNorthAmerica–  680,000peopleinEurope

2[h@ps://blog.newrelic.com/2014/06/13/mobile-app-development-trends-worldwide-need-know/][DeveloperEconomicsQ32014]

Mobile Application Developers

Lackknowledge,tools,andincen=vestodealwith:

–  Security–  Privacy–  Energy-efficiency

3

What Can Go Wrong?

4

What Can Go Wrong?

5

Majorconsumersofenergy:Screen,WiFi,GPS,Sensors,Camera,CPU[Pathaketal.,EuroSys’12,Banerjeeetal.,FSE’14]

6

Example App

GPS location used

GPS location update started

GPS location used

7

Example App

21

GPS location update started

GPS location used

8

Example App

21

GPS location update started

GPS location used

9

Example App

21

1 47%moreenergy

Energy Bugs

Anerrorinthesystemthatcausesanunexpectedamountofhighenergyconsump=on

10 [Pathak et al., HotNets’11]

Energy Bugs and Hotspots

Anapplica=onconsumesanabnormallyhighamountofba^erypower…

•  …evenaQerithascompletedexecuSonàBug

•  …eventhoughtheu=liza=onofitshardwareresourcesislowàHotspot

11 [Banerjee et al., FSE’14]

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

12 [Banerjee et al., FSE’14]

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

13 [Banerjee et al., FSE’14]

Resources(e.g.,WiFi)thatarenotreleasedorthedevicecomponent(e.g.,screen,CPU)isleeinahigh-powerstateaeertheapplica=onhasfinishedexecu=on

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

14 [Banerjee et al., FSE’14]

Afailuretoremoveaservice(e.g.,loca=onorsensorupdates),whichwillkeeponrepor=ngdataeventhoughnoapplica=onneedsit

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

15 [Banerjee et al., FSE’14]

Respawninganapplica=onorservicewhentheapplica=onhasbeenclosedbytheuser

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

16 [Banerjee et al., FSE’14]

Bindingresourcestooearlyorreleasingthemtoolate

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

17 [Banerjee et al., FSE’14]

Sca^eredusageofcomponents(e.g.,screen,WiFi),whichcausestailenergyconsump=onwhencomponentisswitchedoff

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

18 [Banerjee et al., FSE’14]

Fine-grainedinsteadofcoarse-grainupdates(e.g.,GPSvs.WiFibasedloca=on);unnecessarilyhighsamplingrateforaservice

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

19 [Banerjee et al., FSE’14]

Repeatedlyexecu=ngpor=onoftheapplica=onevenifnotnecessary(e.g.,con=nuouslyaccessingunreachableserver)

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

20

•  Pathaketal.,MobiSys’12:sta=canalysistofinddefini=ons(resourceacquisi=on)thatarenotkilled(released)

•  Guoetal.,ASE’13(Relda):buildsaFunc=onCallGraph(callbacksandresource-relatedopera=ons)tocheckwhichresourcesarenotreleased

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

21

•  Liuetal.,PerCom’13(GreenDroid):calculatesu=liza=onra=obyusingdynamictaintanalysis

•  Banerjeeetal.,MobileSoQ’16:improvesbindingloca=onbymatchingdefectanddesignexpressions

GPS location update started

GPS location used

22

Example App

21

1 47%moreenergy

GPS location update started

GPS location used

23

Example App

21

1 47%moreenergy

2 visiblyslower

?

QoS Considerations

“Forbestloca=onaccuracy,youmightchoosetostartlisteningforloca=onupdateswhenusersbegincrea<ngthecontentorevenwhentheapplica<onstarts,<…>”“Youmightneedtoconsiderhowlongatypicaltaskofcrea=ngthecontenttakesandjudgeifthisdura=onallowsforefficientcollec=onofaloca=ones=mate.”

[h^ps://developer.android.com/guide/topics/loca=on/strategies.html]

24

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

25

•  Chenetal.,HotPower’13:prefetchingads;upper-boundis3.2%,hardtoachieve

•  Lietal.,ICSE’16:bundlessequen=alHTTPrequests,15%reduc=on

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

26

Taxonomy of Energy Bugs and Hotspots

HardwareResources

ResourceLeak

Subop=malResourceBinding

Sleep-stateTransi=onHeuris=cs

WakelockBug

TailEnergyHotspot

BackgroundServices

VacuousBackgroundServices

ExpensiveBackgroundServices

Defec=veFunc=onality

ImmortalityBug

LoopBug

27

•  Citoetal.,ASE’16

Advertising and Analytics (A&A)

•  Atleast3third-partylibsinanapp[Rubinatal.,ASE’15]

•  Consume65%-75%ofenergy[Pathaketal.,EuroSys’12]

•  Morethan40%ofHTTPconnec=onsdonotcontributetouser-observablebehavior[Rubinatal.,ASE’15]–Analy=cs

•  Adver=singconsumes16%ofenergy(plus48%moreCPU=meand79%morenetworkdata)[Guietal.,ICSE’15]

28

29

Main Idea

Automa=callyiden=fyrecurrentA&Arequestsandadapttheirfrequencytothecurrentba^erystate.

30

31

Battery Aware Transformation Basedon•  ρ–periodoftherecurrentrequests•  b–ba^erystatusaddadelaybeforerecurrentA&Arequests

32

Linearadapta=on:

Lowpowermode(at20%ba^erystatus):

Savings – an Example

•  VLCDirect:videostreamplayer•  Onerecurrentrequest–every30sec•  Introduced100%delay–to60sec•  Runfor30mins•  5.8%reduc=oninenergyconsump=on

(16%upperbound)

33

Providing Incentives

•  Problem:applica=onsare“greedy”–  Donotconsiderotherapps–  Donotconsiderba^erystatus

•  Inplan:game-theore=calapproachformobileenergymarketplace–  priceenergyandbillapplica=onsfortheenergytheyuse

34

Summary

35

top related