Transcript

Short-term RegionsA Region based Short-term Memory Allocator

Stephanie Stroka • steffueue@gmail.com

MEMORY LEAKS DUE TOPROGRAMMING ERRORS

SHORT-TERM MEMORY

vo id ∗ scm malloc ( s i z e t s ize ) ;vo id scm refresh ( vo id ∗ p t r , i n t e x p i r a t i o n ) ;vo id scm t ick ( ) ;

const i n t scm create reg ion ( ) ;vo id ∗ scm mal loc in reg ion ( s i z e t s ize ,

const i n t r e g i d ) ;vo id scm re f resh reg ion ( const i n t reg id ,

i n t e x p i r a t i o n ) ;vo id scm refresh ( vo id ∗ p t r , i n t e x p i r a t i o n ) ;vo id scm t ick ( ) ;

Performance gain of STR compared to MALLOC.

SINGLE-THREADED

AVG 55.47 %MIN 51.97 %MAX 58.44 %MULTI-THREADED

AVG 65.47 %MIN 52.94 %MAX 70.11 %

Performance gain of STR compared to STM.

SINGLE-THREADED

AVG 79.60 %MIN 78.80 %MAX 80.39 %MULTI-THREADED

AVG 87.26 %MIN 75.51 %MAX 95.20 %

1000

10000

100000

1e+06

0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000

Mem

ory

(byte

s, lo

gscale

)

Allocation Phase

Memory Consumption - sh6bench multi-threaded, nonleaky

MALLOC areaMALLOC gross memory

STM areaSTM gross memory

STR areaSTR gross memory

STRMC areaSTRMC gross memory

net memory

1000

10000

100000

1e+06

1e+07

0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000

Mem

ory

(byte

s, lo

gscale

)

Allocation Phase

Memory Consumption - sh6bench multi-threaded, leaky

MALLOC_LEAK areaMALLOC_LEAK gross memory

STM_LEAK areaSTM_LEAK gross memory

STR_LEAK areaSTR_LEAK gross memory

STRMC_LEAK areaSTRMC_LEAK gross memory

net memory

1000

10000

100000

1e+06

1e+07

0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000

Mem

ory

(byte

s, lo

gscale

)

Allocation Phase

Memory Consumption - sh6bench multi-threaded, leaky

MALLOC_LEAK areaMALLOC_LEAK gross memory

STM_LEAK areaSTM_LEAK gross memory

STR_LEAK areaSTR_LEAK gross memory

STRMC_LEAK areaSTRMC_LEAK gross memory

net memory

The percentage of unused (allocated, but not needed) memoryin sh6bench.

Fragmentation in %single-threaded multi-threaded

MALLOC 1.0700 17.1700MALLOC LEAK 99.3000 99.3700STM 26.0100 72.2400STM LEAK 27.7000 71.0900STR 37.0000 81.6300STR LEAK 39.1100 82.6400

PERFORMANCE AT ACOST OF MEMORY,NO MEMORY LEAKS

top related