Prioritized Garbage Collection Using the Garbage Collector to - - PowerPoint PPT Presentation

prioritized garbage collection using the garbage
SMART_READER_LITE
LIVE PREVIEW

Prioritized Garbage Collection Using the Garbage Collector to - - PowerPoint PPT Presentation

Prioritized Garbage Collection Using the Garbage Collector to Support Caching Diogenes Nunez , Samuel Z. Guyer, Emery D. Berger Tufts University, University of Massachusetts Amherst November 2, 2016 D. Nunez, S. Guyer, E. Berger Prioritized GC


slide-1
SLIDE 1

Prioritized Garbage Collection Using the Garbage Collector to Support Caching

Diogenes Nunez, Samuel Z. Guyer, Emery D. Berger

Tufts University, University of Massachusetts Amherst

November 2, 2016

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 1 / 47

slide-2
SLIDE 2

Caches are everywhere

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 2 / 47

slide-3
SLIDE 3

Caches are everywhere

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 2 / 47

slide-4
SLIDE 4

Caches are everywhere

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 2 / 47

slide-5
SLIDE 5

Caches are everywhere

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 2 / 47

slide-6
SLIDE 6

Caches are a space-time tradeoff.

5 10 15 20 25 30 35 40 50 100 150 200 250 300 350 400 450 500 550 600 Time (sec) Number of cache entries Total Runtime

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 3 / 47

slide-7
SLIDE 7

Caches are a space-time tradeoff.

5 10 15 20 25 30 35 40 50 100 150 200 250 300 350 400 450 500 550 600 Time (sec) Number of cache entries Total Runtime

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 4 / 47

slide-8
SLIDE 8

Caches are a space-time tradeoff.

5 10 15 20 25 30 35 40 50 100 150 200 250 300 350 400 450 500 550 600 Time (sec) Number of cache entries Total Runtime

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 5 / 47

slide-9
SLIDE 9

Caches are a space-time tradeoff?

5 10 15 20 25 30 35 40 50 100 150 200 250 300 350 400 450 500 550 600 Time (sec) Number of cache entries Total Runtime

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 6 / 47

slide-10
SLIDE 10

Garbage collection dominates runtime.

5 10 15 20 25 30 35 40 50 100 150 200 250 300 350 400 450 500 550 600 Time (sec) Number of cache entries Other GC

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 7 / 47

slide-11
SLIDE 11

Perfect Cache Size

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 8 / 47

slide-12
SLIDE 12

Elements can be too small.

The cache can use more space.

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 9 / 47

slide-13
SLIDE 13

Elements can be too big.

The cache needs to use less space.

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 10 / 47

slide-14
SLIDE 14

Evicted elements remain in memory until next GC.

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 11 / 47

slide-15
SLIDE 15

Evicted elements remain in memory until next GC.

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 12 / 47

slide-16
SLIDE 16

Evicted elements remain in memory until next GC.

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 13 / 47

slide-17
SLIDE 17

Problem

Can we . . . Keep the garbage collector from dominating program run time Handle entries of various sizes

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 14 / 47

slide-18
SLIDE 18

Soft References

Removed prior to an OutOfMemory exception JVMs can remove them during normal operation

◮ Hotspot removes them over time in a Least-Recently-Used (LRU) order

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 15 / 47

slide-19
SLIDE 19

All soft references are equal.

All Soft References placed in a global queue Queue is cleared in an LRU policy over time Results in removal of cache values from cold code

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 16 / 47

slide-20
SLIDE 20

Our Solution

Make the Garbage Collector aware of the cache and its contents

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 17 / 47

slide-21
SLIDE 21

Our Solution

Prioritized Garbage Collector

◮ Separate the references into logical spaces with unique eviction policies ◮ Compute how much memory each reference is responsible for

Sache

◮ Use the Prioritized Garbage Collector to limit the memory used by

stored values

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 18 / 47

slide-22
SLIDE 22

Prioritized Garbage Collection: Using PrioSpaces

// Specify memory limit in number of bytes ... PrioSpace <Tree > space = VM.getSpace (500); //.. or percentage of heap PrioSpace <Tree > space = VM.getSpace (0.6);

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 19 / 47

slide-23
SLIDE 23

Register objects into a PrioSpace

Tree t; PrioReference <T> ref = space.newReference (t);

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 20 / 47

slide-24
SLIDE 24

Updates the reference’s priority every use.

PrioReference <Tree > ref; Tree t = ref.get (); /* Results in a call to * space. updateReference (t); */

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 21 / 47

slide-25
SLIDE 25

Compare two PrioReferences

int compare(PrioReference <T> a, PrioReference <T> b); Determines the eviction policy of the space given by programmer

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 22 / 47

slide-26
SLIDE 26

Compare two PrioReferences

int compare(PrioReference <T> a, PrioReference <T> b); Determines the eviction policy of the space given by programmer Determines the priority of a reference in the space

◮ Higher priority → More likely to not be evicted

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 22 / 47

slide-27
SLIDE 27

Prioritized Garbage Collection: Cleaning PrioSpaces

For each PrioSpace, garbage collector calculates and stores the amount of memory used by strucures Garbage collector frees structures according to priority of the references

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 23 / 47

slide-28
SLIDE 28

Sache (Space Aware Cache)

User puts a limit on size of Sache in bytes Tell the prioritized garbage collector what values are in the cache and the order of eviction

◮ Current eviction policy is LRU

Measure the amount of memory used by these values during garbage collection If keeping a value means the Sache exceeds the size limit, evict that value

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 24 / 47

slide-29
SLIDE 29

Sache: Interface

class Sache <K,V> extends HashMap <K, PrioReference <V>> { protected int priority; protected PrioSpace <V> priospace; public Sache(long maxSize ); public boolean put(K key , V value ); public V get(K key); public V remove(K key); private void update (); }

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 25 / 47

slide-30
SLIDE 30

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC space: a b c d e f g h i

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-31
SLIDE 31

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-32
SLIDE 32

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-33
SLIDE 33

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: d a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-34
SLIDE 34

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: d a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-35
SLIDE 35

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: a d a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-36
SLIDE 36

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: a d a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-37
SLIDE 37

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: h a d a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-38
SLIDE 38

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: h a d a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-39
SLIDE 39

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: d h a a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-40
SLIDE 40

Sache: Using Sache

Sache map = new Sache(60); map.put("1", d); map.put("2", a); map.put("3", h); map.get("1"); //Garbage collection occurs Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes space: d h a a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 26 / 47

slide-41
SLIDE 41

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-42
SLIDE 42

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-43
SLIDE 43

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-44
SLIDE 44

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-45
SLIDE 45

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h a

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-46
SLIDE 46

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h a

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-47
SLIDE 47

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h a i

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-48
SLIDE 48

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h a i

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-49
SLIDE 49

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h a map i

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-50
SLIDE 50

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h a e i map

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-51
SLIDE 51

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 0 bytes space: d h a a b c d e f g h i map d h a i map e

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-52
SLIDE 52

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 12 bytes space: d h a a b c d e f g h i map d h a i map e d

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-53
SLIDE 53

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 24 bytes space: d h a a b c d e f g h i map d h a i map e f d

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-54
SLIDE 54

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 36 bytes space: d h a a b c d e f g h i map d h a i map e b d f

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-55
SLIDE 55

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 48 bytes space: d h a a b c d e f g h i map d h a i map e g d f b

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-56
SLIDE 56

Prioritized GC: Measuring Sizes

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 60 bytes space: d h a a b c d e f g h i map d h a i map e h d f b g

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 27 / 47

slide-57
SLIDE 57

Prioritized GC: Eviction

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 72 bytes space: d h a a b c d e f g h i map d h a i map e f b g a

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 28 / 47

slide-58
SLIDE 58

Prioritized GC: Eviction

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 60 bytes space: d h a a b c d e f g h i map d h a i map e f b g a

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 28 / 47

slide-59
SLIDE 59

Prioritized GC: Eviction

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 60 bytes space: d h a b c d e f g h i map d h a i map e f b g a

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 29 / 47

slide-60
SLIDE 60

Prioritized GC: Sweep

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 60 bytes space: d h a b d e f g h i map d h a i map e f b g a

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 30 / 47

slide-61
SLIDE 61

Sache evicts upon next access

Mark entries in space Mark roots Depth-first search from roots Depth-first search from space entries Free all unmarked objects Marked by Mark Sweep Marked by Prioritized GC limit = 60 bytes current-total = 60 bytes space: d h a b d e f g h i map d h a i map e f b g a

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 31 / 47

slide-62
SLIDE 62

Experiments: Traces Used

Traces are list of (string, int) pairs string: unique string identifier int: size of structure to create

◮ drawn from a predetermined range

Request sequence follows Pareto distribution1

  • 1C. Cunha, A. Bestavros, and M. Crovella. Characteristics of www client-based
  • traces. Technical report, Boston, MA, USA, 1995.
  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 32 / 47

slide-63
SLIDE 63

Experiments

Trace driven

◮ Program reads requests: (string, int) pairs ◮ Program looks the string up in the cache ◮ If the read fails, create and store a tree of the requested size in the

cache

Change the cache used

◮ Google Guava with LRU policy at fixed sizes ◮ Sache at fixed sizes

Implemented Prioritized GC in Jikes Research Virtual Machine

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 33 / 47

slide-64
SLIDE 64

Results: Workloads (50KB − 100KB)

2 4 6 8 10 12 14 16 200 400 600 800 1000 1200 Time (sec) Number of entries Total Runtime Guava LRU Sache 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 200 400 600 800 1000 1200 Hit Rate Number of entries Hit Rate of the Cache Guava LRU Sache

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 34 / 47

slide-65
SLIDE 65

Results: Workloads (100KB − 200KB)

20 40 60 80 100 120 140 100 200 300 400 500 600 Time (sec) Number of entries Total Runtime Guava LRU Sache 0.1 0.2 0.3 0.4 0.5 0.6 0.7 100 200 300 400 500 600 Hit Rate Number of entries Hit Rate of the Cache Guava LRU Sache

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 34 / 47

slide-66
SLIDE 66

Our Solution: Sache (Space Aware Cache)

User puts a limit on size of Sache in bytes Tell the garbage collector what values are in the cache Measure the size of these values during garbage collection If keeping a value means the Sache exceeds its size limit, evict that value

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 35 / 47

slide-67
SLIDE 67

Our Solution: Adaptive Sache (Space Aware Cache)

User puts a limit on size of Sache in bytes Tell the garbage collector what values are in the cache Each collection, calculate limit on size of Sache in bytes Measure the size of these values during garbage collection If keeping a value means the Sache exceeds its size limit, evict that value

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 35 / 47

slide-68
SLIDE 68

Adaptive Sache: Calculating Size Limits

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 36 / 47

slide-69
SLIDE 69

Adaptive Sache: Calculating Size Limits

Live data

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 37 / 47

slide-70
SLIDE 70

Adaptive Sache: Calculating Size Limits

Live data Reserved for computation

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 38 / 47

slide-71
SLIDE 71

Adaptive Sache: Calculating Size Limits

Live data Reserved for computation Sache use

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 39 / 47

slide-72
SLIDE 72

Experiments: Memory Pressure

Trace driven

◮ Use the workload with sizes in 50KB − 100KB range ◮ After a third of requests read, increase memory pressure ◮ After another third, decrease memory pressure

Change the cache used

◮ Google Guava with LRU policy fixed at 350 entries ◮ Adaptive Sache with reserve of 50%

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 40 / 47

slide-73
SLIDE 73

Results: Pressured Workload Trace: Total Run Time

1000 2000 3000 4000 5000 10 20 30 40 50 60 70 80 Time (ms) Memory pressure (MB) Guava LRU Sache

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 41 / 47

slide-74
SLIDE 74

Results: Pressured Workload Trace: Total GC Time

500 1000 1500 2000 2500 10 20 30 40 50 60 70 80 GC Time (ms) Memory pressure (MB) Guava LRU Sache

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 41 / 47

slide-75
SLIDE 75

Results: Adaptive Sache on Pressured Workload Trace

Add lines to note when memory pressure starts and ends

100 200 300 400 500 600 700 800 2 4 6 8 10 Number of entries GC Number Number of Entries in Sache After Each Collection

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 42 / 47

slide-76
SLIDE 76

Conclusion

Prioritized Garbage Collector allows programmers to handle references in application-specific ways Sache uses the Prioritized Garbage Collector to enforce memory limits Sache can adapt its size to memory pressure, improving robustness

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 43 / 47

slide-77
SLIDE 77

Questions?

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 44 / 47

slide-78
SLIDE 78

Backups

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 45 / 47

slide-79
SLIDE 79

Saches and SoftReference Caches: Hotspot

20 40 60 80 100 10 20 30 40 50 60 70 80 90 100 Ratio of Cache Hit Rates Heap Size (MB) Freq = 1 Freq = 2 Freq = 3 Freq = 4 Freq = 5 Freq = 6 Freq = 7 Freq = 8 Freq = 9 Freq = 10

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 46 / 47

slide-80
SLIDE 80

Saches and SoftReference Caches: Sache

20 40 60 80 100 10 20 30 40 50 60 70 80 90 100 Ratio of Cache Hit Rates Heap Size (MB) Freq = 1 Freq = 2 Freq = 3 Freq = 4 Freq = 5 Freq = 6 Freq = 7 Freq = 8 Freq = 9 Freq = 10

  • D. Nunez, S. Guyer, E. Berger

Prioritized GC November 2, 2016 47 / 47