En Energy-Ef -Efficie iency y in in M Mobi obile Sof Softw - - PowerPoint PPT Presentation

en energy ef efficie iency y in in m mobi obile sof softw
SMART_READER_LITE
LIVE PREVIEW

En Energy-Ef -Efficie iency y in in M Mobi obile Sof Softw - - PowerPoint PPT Presentation

En Energy-Ef -Efficie iency y in in M Mobi obile Sof Softw tware Julia Rubin (jointly with Duling Lai, Jrgen Cito, Phillip Stanley-Marbell) January 31, 2017 Mobile Applications More than 2 billion smartphones in use More than


slide-1
SLIDE 1

En Energy-Ef

  • Efficie

iency y in in M Mobi

  • bile Sof

Softw tware

Julia Rubin

(jointly with Duling Lai, Jürgen Cito, Phillip Stanley-Marbell)

January 31, 2017

slide-2
SLIDE 2

Mobile Applications

  • More than 2 billion smartphones in use

– More than desktop computers – Plus smart watches, glasses, cameras, TVs, in-car naviga=on, and messaging

  • More than 3 million mobile apps in official app stores

– … and much more apps in hundreds of alterna=ve stores

  • ~2.3 million ac=ve mobile developers worldwide

– 760,000 people in Asia – 680,000 people in North America – 680,000 people in Europe

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

slide-3
SLIDE 3

Mobile Application Developers

Lack knowledge, tools, and incen=ves to deal with:

– Security – Privacy – Energy-efficiency

3

slide-4
SLIDE 4

What Can Go Wrong?

4

slide-5
SLIDE 5

What Can Go Wrong?

5

Major consumers of energy: Screen, WiFi, GPS, Sensors, Camera, CPU

[Pathak et al., EuroSys’12, Banerjee et al., FSE’14]

slide-6
SLIDE 6

6

Example App

GPS location used

slide-7
SLIDE 7

GPS location update started GPS location used

7

Example App

2 1

slide-8
SLIDE 8

GPS location update started GPS location used

8

Example App

2 1

slide-9
SLIDE 9

GPS location update started GPS location used

9

Example App

2 1 1

47% more energy

slide-10
SLIDE 10

Energy Bugs

An error in the system that causes an unexpected amount of high energy consump=on

10

[Pathak et al., HotNets’11]

slide-11
SLIDE 11

Energy Bugs and Hotspots

An applica=on consumes an abnormally high amount of ba^ery power …

  • … even aQer it has completed execuSon à Bug
  • … even though the u=liza=on of its hardware

resources is low à Hotspot

11

[Banerjee et al., FSE’14]

slide-12
SLIDE 12

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

12

[Banerjee et al., FSE’14]

slide-13
SLIDE 13

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

13

[Banerjee et al., FSE’14]

Resources (e.g., WiFi) that are not released or the device component (e.g., screen, CPU) is lee in a high- power state aeer the applica=on has finished execu=on

slide-14
SLIDE 14

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

14

[Banerjee et al., FSE’14]

A failure to remove a service (e.g., loca=on or sensor updates), which will keep on repor=ng data even though no applica=on needs it

slide-15
SLIDE 15

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

15

[Banerjee et al., FSE’14]

Respawning an applica=on or service when the applica=on has been closed by the user

slide-16
SLIDE 16

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

16

[Banerjee et al., FSE’14]

Binding resources too early

  • r releasing them too late
slide-17
SLIDE 17

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

17

[Banerjee et al., FSE’14]

Sca^ered usage of components (e.g., screen, WiFi), which causes tail energy consump=on when component is switched off

slide-18
SLIDE 18

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

18

[Banerjee et al., FSE’14]

Fine-grained instead of coarse- grain updates (e.g., GPS vs. WiFi based loca=on); unnecessarily high sampling rate for a service

slide-19
SLIDE 19

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

19

[Banerjee et al., FSE’14]

Repeatedly execu=ng por=on

  • f the applica=on even if not

necessary (e.g., con=nuously accessing unreachable server)

slide-20
SLIDE 20

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

20

  • Pathak et al., MobiSys’12:

sta=c analysis to find defini=ons (resource acquisi=on) that are not killed (released)

  • Guo et al., ASE’13 (Relda):

builds a Func=on Call Graph (callbacks and resource-related opera=ons) to check which resources are not released

slide-21
SLIDE 21

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

21

  • Liu et al., PerCom’13 (GreenDroid):

calculates u=liza=on ra=o by using dynamic taint analysis

  • Banerjee et al., MobileSoQ’16:

improves binding loca=on by matching defect and design expressions

slide-22
SLIDE 22

GPS location update started GPS location used

22

Example App

2 1 1

47% more energy

slide-23
SLIDE 23

GPS location update started GPS location used

23

Example App

2 1 1

47% more energy

2

visibly slower

?

slide-24
SLIDE 24

QoS Considerations

“For best loca=on accuracy, you might choose to start listening for loca=on updates when users begin crea<ng the content or even when the applica<on starts, <…>” “You might need to consider how long a typical task of crea=ng the content takes and judge if this dura=on allows for efficient collec=on of a loca=on es=mate.”

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

24

slide-25
SLIDE 25

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

25

  • Chen et al., HotPower’13:

prefetching ads; upper-bound is 3.2%, hard to achieve

  • Li et al., ICSE’16:

bundles sequen=al HTTP requests, 15% reduc=on

slide-26
SLIDE 26

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

26

slide-27
SLIDE 27

Taxonomy of Energy Bugs and Hotspots

Hardware Resources

Resource Leak Subop=mal Resource Binding

Sleep-state Transi=on Heuris=cs

Wakelock Bug Tail Energy Hotspot

Background Services

Vacuous Background Services Expensive Background Services

Defec=ve Func=onality

Immortality Bug Loop Bug

27

  • Cito et al., ASE’16
slide-28
SLIDE 28

Advertising and Analytics (A&A)

  • At least 3 third-party libs in an app [Rubin at al., ASE’15]
  • Consume 65%-75% of energy [Pathak et al., EuroSys’12]
  • More than 40% of HTTP connec=ons do not contribute to

user-observable behavior [Rubin at al., ASE’15] – Analy=cs

  • Adver=sing consumes 16% of energy (plus 48% more CPU =me

and 79% more network data) [Gui et al., ICSE’15]

28

slide-29
SLIDE 29

29

slide-30
SLIDE 30

Main Idea

Automa=cally iden=fy recurrent A&A requests and adapt their frequency to the current ba^ery state.

30

slide-31
SLIDE 31

31

slide-32
SLIDE 32

Battery Aware Transformation

Based on

  • ρ – period of the recurrent requests
  • b – ba^ery status

add a delay before recurrent A&A requests

32

Linear adapta=on: Low power mode (at 20% ba^ery status):

slide-33
SLIDE 33

Savings – an Example

  • VLC Direct: video stream player
  • One recurrent request – every 30 sec
  • Introduced 100% delay – to 60 sec
  • Run for 30 mins
  • 5.8% reduc=on in energy consump=on

(16% upper bound)

33

slide-34
SLIDE 34

Providing Incentives

  • Problem: applica=ons are “greedy”

– Do not consider other apps – Do not consider ba^ery status

  • In plan: game-theore=cal approach for mobile energy

marketplace – price energy and bill applica=ons for the energy they use

34

slide-35
SLIDE 35

Summary

35