low-overhead memory leak detection using adaptive statistical profiling

20
Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling ZHANG Hansheng 1 Nov 2013

Upload: anthony-cabrera

Post on 01-Jan-2016

21 views

Category:

Documents


2 download

DESCRIPTION

Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling. ZHANG Hansheng 1 Nov 2013. About the Paper. In Proceedings of the 11th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS 2004) - PowerPoint PPT Presentation

TRANSCRIPT

Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling

ZHANG Hansheng1 Nov 2013

• In Proceedings of the 11th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS 2004)

• Trishul M. Chilimbi, Microsoft Research, One Microsoft Way, Redmond, WA

• Matthias Hauswirth, University of Colorado at Boulder , Boulder, CO

About the Paper

Arnold-Ryder framework

startup:nCheck = nCheck0If nCheck > 0 run checking code decrease nCheckelse run instrumented code nCheck = nCheck0

𝑠𝑎𝑚𝑝𝑙𝑖𝑛𝑔𝑟𝑎𝑡𝑒=1

h𝑛𝐶 𝑒𝑐𝑘0+1

Bursty Tracing

startup: nCheck = nCheck0 nInstr = 0If nCheck > 0 run checking code decrease nCheck if nCheck=0 nInstr=nInstr0if nInstr>0 run instrumented code decreate nInstr if nInstr=0 nCheck=nCheck0

𝑠𝑎𝑚𝑝𝑙𝑖𝑛𝑔𝑟𝑎𝑡𝑒=𝑛𝐼𝑛𝑠𝑡𝑟 0

h𝑛𝐶 𝑒𝑐𝑘0+𝑛𝐼𝑛𝑠𝑡𝑟 0

• sampling rate of frequently executed code decrease quickly until reaching a lower bound

• ABT is used to trace frequent events (memory access)

• Infrequent events (memory allocations) are fully traced

Adaptive Bursty Tracing (ABT)

• Requirements• AllocateObject(ip, startAddress, size)

• FreeObject(ip, startAddress)

• FindObject(ip, addresss)

• GetObjectIterator

• Implementations• Hash table (address->objectInfo)

• Hash table (startAddress->objectInfo)• Hash table (address->offsetToStartAddress)

• Address tree

Heap Model

0

0

0

0

0

0 00

0 0 0 0 0 0 0

0000 10000100 1100

1

1

1

1

1

1 11

1 1 1 1 1 1 1

Address: 0101

0101

Heap Model

Slides showing heap model are copied from: http://research.microsoft.com/en-us/um/people/trishulc/swatpresentation3.ppt

8

0

0

0

0

0

0 00

0 0 0 0 0 0 0

0000 10000100 1100

1

1

1

1

1

1 11

1 1 1 1 1 1 1

8 byte0101

Heap Model

0

0

0

0

0

0 00

0 0 0 0 0 0 0

0000 10000100 1100

1

1

1

1

1

1 11

1 1 1 1 1 1 1

Heap Model

10

0

0 0

0 00

0 0 0 0 0

0000 10000100 1100

1

1 1

1 11

1 1 1 1 1

Heap Model

11

0

0 0

0 00

0 0 0 0 0

0000 10000100 1100

1

1 1

1 11

1 1 1 1 1

Heap Model

12

0

0 0

00

0 0

0000 10000100 1100

1

1 1

11

1 1

Heap Model

13

0

0 0

00

0 0

1

1 1

11

1 1

Start address: 0101Size: 8Access count: 19Last access time: 19’000’000Alloc site:EIP 0x400019Last access site: EIP 0x400190

Heap Model

Leak Reporting

• Benchmarks• SPECInt2000

• Largest data

• Case study• Large Interactive Web Application

• 3rd Party PC Game (Strategy)

• Multimedia Application

• First Party PC Game (Simulation)

Experiments

Runtime Overhead

Space Overhead

Impact of Adaptive Profiling on Leak Detection

Staleness Prediction Evaluation

Case Studies