Optimisation of virtual machine garbage collection policies
ASMTA’11 Simonetta Balsamo Gian-Luca Dei Rossi Andrea Marin
Dipartimento di Scienze Ambientali, Informatica e Statistica Universit` a Ca’ Foscari, Venezia
June 22, 2011
Optimisation of virtual machine garbage collection policies ASMTA11 - - PowerPoint PPT Presentation
Optimisation of virtual machine garbage collection policies ASMTA11 Simonetta Balsamo Gian-Luca Dei Rossi Andrea Marin Dipartimento di Scienze Ambientali, Informatica e Statistica Universit` a Ca Foscari, Venezia June 22, 2011
ASMTA’11 Simonetta Balsamo Gian-Luca Dei Rossi Andrea Marin
Dipartimento di Scienze Ambientali, Informatica e Statistica Universit` a Ca’ Foscari, Venezia
June 22, 2011
Optimisation of virtual machine garbage collection policies 2 of 20
Automatic memory management (Garbage Collection)
Many different technologies
Performance optimisation strategies:
Optimisation of virtual machine garbage collection policies 3 of 20
discrete random variable probability distribution.
memory is full.
rate γi.
with rate βi.
instantaneously.
Optimisation of virtual machine garbage collection policies 4 of 20
State: a triplet (c, i, g), where
When there is no customer in the system, i.e., c = 0, memory is always completely unallocated and the garbage collector is inactive, i.e., i = 0, g = OFF. Formally E = (0, 0, OFF) ∪ {(c, i, g)|c ∈ N>0, i ∈ {1 . . . B}, g ∈ {ON, OFF}}. The model is a Quasi-Birth-Death Process and is solvable using a Matrix Geometric method [3, 2].
Optimisation of virtual machine garbage collection policies 5 of 20
1 2 . . . λ′ λ λ µ′ µ µ
Q = B00 B01 . . . B10 A1 A2 . . . A0 A1 A2 . . . A0 A1 A2 . . . ... ... ... . . . . . . . . . . . . . . . . . . . . .
adjacent levels.
identical structure.
Optimisation of virtual machine garbage collection policies 6 of 20
(1, 1, OFF) (1, 2, OFF) (1, B − 1, OFF) (1, B, OFF) (1, 1, ON) (1, 2, ON) (1, B − 1, ON) (1, B, ON) α1 α2 αB−1 αB βB−1 β2 β1 γ2 γB . . . γB−1 γ3 . . . . . . . . . βB (0, 0, OFF) µ1 µ2 µB−1 µB λ
Optimisation of virtual machine garbage collection policies 7 of 20
(n, 1, OFF) (n, 2, OFF) (n, B − 1, OFF) (n, B, OFF) (n, 1, ON) (n, 2, ON) (n, B − 1, ON) (n − 1, 1, ON) (n − 1, 2, ON) (n − 1, B − 1, ON) (n − 1, B, ON) (n − 1, 1, OFF) (n − 1, 2, OFF) (n − 1, B − 1, OFF) (n − 1, B, OFF) (n + 1, 1, OFF) (n + 1, 2, OFF) (n + 1, B − 1, OFF) (n + 1, B, OFF) (n, B, ON) (n + 1, 1, ON) (n + 1, 2, ON) (n + 1, B − 1, ON) (n + 1, B, ON) α1 α2 αB−1 αB βB−1 β2 β1 γ2 γB . . . γB−1 γ3 . . . . . . . . . λ λ λ λ λ λ λ λ λ µB µ1 µ2 µB−1 βB . . . . . .
Optimisation of virtual machine garbage collection policies 8 of 20
B0(i) =
2
if i is odd
B1(1) = −λ B2(j) = λ if j = 1
A0(i, j) =
2
if i = j and i, j are odd
A1(i, j) = α i+1
2
if j = i + 1 ∧ i is odd β i
2
if j = i − 1 ∧ i is even γ i
2
if j = i − 2 ∧ i is even −
(A0(i, k) + A1(i, k) + A2(i, k)) if i = j
(1) A2(i, j) = λ if j = i + 2 λ if (i = 2B ∨ i = 2B − 1) ∧ j = 2B
Optimisation of virtual machine garbage collection policies 9 of 20
The model is a QBD processes
Performance indices in function of a variable parameter
the GC activation rate?
Optimisation of virtual machine garbage collection policies 10 of 20
Where to search for a minimum? Proposition If the optimisation problem α∗ = argminαR(α) admits a solution, then the following inequality holds: 0 < α∗ < (β + γ)(µ+ − λ) λ , where µ+ = maxi(µi), 0 ≤ i ≤ B. ATM no proof for minimum existence or uniqueness.
Optimisation of virtual machine garbage collection policies 11 of 20
Where not stated otherwise, the parameters are the following Parameter Name Value B 50 λ 3.0 βi 3 ∀i ∈ {1 . . . B} γi 25 ∀i ∈ {1 . . . B} µi 5.0 for 1 ≤ i ≤ B/2, 0.05 for B/2 < i ≤ B
Table: Parameter Values in Numerical Examples
Optimisation of virtual machine garbage collection policies 12 of 20
0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96
Garbage Collector Activation Rate Mean Response Time
Figure: An example of the function R
Optimisation of virtual machine garbage collection policies 13 of 20
2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05
Customer Arrival Rate Optimal Garbage Collector Activation Rate
Figure: Optimal α value in function of λ
Optimisation of virtual machine garbage collection policies 14 of 20
0.6 0.7 0.8 0.9 1 1.1 1.2 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85
Garbage Collector Activation Rate Utilisation
Figure: ρ value in function of α
Optimisation of virtual machine garbage collection policies 15 of 20
Use the model to determine on flight the optimum garbage collector activation rates αi for a real system with GC in order to minimise the average response time. Suppose that we can measure:
B
λ
µi
memory ¯ γi
the program ¯ βi Where i = ¯ B − f is the number of allocated memory blocks. Easily measurable stats, e.g., using the
JVM.
Optimisation of virtual machine garbage collection policies 16 of 20
Parameter α is unbound.
the values of αi ∀i
probabilities. Once determined the optimum α value, this is set as the activation rate for the GC of the real system. What if some measured values changes, e.g., ¯ λ, or more data is recovered, e.g., for new values of i?
generated.
Optimisation of virtual machine garbage collection policies 17 of 20
collection
collection activation rates
Future works:
Optimisation of virtual machine garbage collection policies 18 of 20
[1] Matthew Hertz and Emery D. Berger. Quantifying the performance of garbage collection vs. explicit memory management. SIGPLAN Not., 40(10):313–326, October 2005. [2] G. Latouche and V. Ramaswami. Introduction to Matrix Anlytic Methods in Stochastic Modeling. Statistics and applied probability. ASA-SIAM, Philadelphia, PA, 1999. [3] M. F. Neuts. Matrix Geometric Solutions in Stochastic Models. John Hopkins, Baltimore, Md, 1981.
Optimisation of virtual machine garbage collection policies 19 of 20
Optimisation of virtual machine garbage collection policies 20 of 20
The minimum of the utilisation ρ is different from the minimum of the average response time R. This behaviour can be explained by the fact that, for this model, given two distribution π and π′, after a certain k, π(k + i) < π′(k + i) for i ∈ N even if π(0) > π′(0).
Optimisation of virtual machine garbage collection policies 21 of 20
1 2 3 4 5 6 7 8 9 0.05 0.1 0.15 0.2 0.25
Number of Customers Stationary Probability α = 0.7 α = 0.9
Figure: Vector π for two different α values and λ = 3
Optimisation of virtual machine garbage collection policies 22 of 20