Download presentation
Presentation is loading. Please wait.
1
Program-level Adaptive Memory Management
Chengliang Zhang, Kirk Kelsey, Xipeng Shen, Chen Ding, Matthew Hertz* and Mitsunori Ogihara Computer Science Department University of Rochester *Computer Science Department Canisius College 8/20/2019 ISMM'06
2
Performance vs. Heap Size
Working set size > physical memory paging With garbage collection Small heap large GC cost physical memory Time Heap size 8/20/2019 ISMM'06
3
Performance vs. Heap Size (Cont.)
pseudoJBB, 192MB PM, CopyMS, FastAdaptive 8/20/2019 ISMM'06
4
Specifying a Heap Size Manually specifying a heap size is not easy
The actual memory usage depends on the GC scheme Semi-space uses twice memory as needed It is not easy to know the physical memory available for the program OS, JVM The available physical memory could change Other programs start and stop 8/20/2019 ISMM'06
5
Program-level Adaptive Memory Management Scheme
Automatically picks the right heap size based on information from the JVM and the OS No need to change JVM Just use Runtime.totalMemory(), Runtime.freeMemory() and System.gc() No need to change the OS Get paging information from /proc 8/20/2019 ISMM'06
6
Outline Motivation Program level adaptive memory management scheme
Experiment setup Results Conclusion and future work 8/20/2019 ISMM'06
7
Program-level Adaptive Memory Management Scheme
Runtime.totalMemory Runtime.freeMemory Paging /proc program PAMM controller System.gc() 8/20/2019 ISMM'06
8
Program-level Adaptive Memory Management Scheme
Runtime.totalMemory Runtime.freeMemory Paging /proc program PAMM controller Use Soot to add a hook at the phase boundaries System.gc() 8/20/2019 ISMM'06
9
Program-level Adaptive Memory Management Scheme
Too frequent too much overhead Too infrequent unresponsive Runtime.totalMemory Runtime.freeMemory Paging /proc program PAMM controller System.gc() 8/20/2019 ISMM'06
10
Information Gathering Thresholds
The amount of memory change between two checks is at most 1MB sensitive enough Total overhead < 1% low overhead 8/20/2019 ISMM'06
11
Program-level Adaptive Memory Management Scheme
Control model Runtime.totalMemory Runtime.freeMemory Paging /proc program PAMM controller System.gc() 8/20/2019 ISMM'06
12
Control Model H: current used heap size
S: controller maintained softbound H > S? mutator paging? T F GC GC Control Model GC paging? GC paging? T F T F S S S return to mutator 8/20/2019 ISMM'06
13
Maintaining the Softbound
Goal: find and stabilize the softbound We use a left mark and a right mark to record the range of the softbound and do binary search between them The left mark: start heap size The right mark: infinite Softbound: 8M right of the left mark Left mark Softbound Right mark 8/20/2019 ISMM'06
14
Increasing the Softbound
The left mark is set to be the current heap size If the right mark does not exist, then increase the softbound aggressively (by 8M) Otherwise, move softbound in the middle of the current heap size and the right bound If right bound is too small, move both the right bound and the softbound right (by 1M) 8/20/2019 ISMM'06
15
Decreasing the Softbound
The right mark is set to be the current heap size Move the softbound in the middle of the left mark and the right mark If the left mark is too big, then move both the left mark and the softbound left by 1M 8/20/2019 ISMM'06
16
Outline Motivation Program level adaptive memory management scheme
Experiment setup Results Conclusion and future work 8/20/2019 ISMM'06
17
Experiment Setup Jikes RVM Garbage collectors MarkSweep CopyMS GenCopy
8/20/2019 ISMM'06
18
Benchmarks pseudoJBB ipsixql 4 SPECjvm98 benchmarks
201_compress, 202_jess, 209_db and 227_mtrt Second run technique to exclude optimization time 8/20/2019 ISMM'06
19
pseudoJBB, 128MB PM, BaseBase
8/20/2019 ISMM'06
20
pseudoJBB, 128MB PM, FastAdaptive
8/20/2019 ISMM'06
21
pseudoJBB, 192MB PM, FastAdaptive
8/20/2019 ISMM'06
22
ipsixql, 128MB PM, FastAdaptive
8/20/2019 ISMM'06
23
pseudoJBB, 128MB PM, FastAdptive
Stabilization pseudoJBB, 128MB PM, FastAdptive 8/20/2019 ISMM'06
24
PAMM vs. Best Fixed Heap Size
Best: Best fixed heap size, differs based on programs, GC, and compiler opt 8/20/2019 ISMM'06
25
PAMM vs. Default Setting
Default: from 50M to 100M 8/20/2019 ISMM'06
26
Comparison Scope Changes PAMM VM, OS, Program Program
GC Hints [Buytaert+:HIPEAC05] Preventive GC [Ding+:MSP05] Automatic Heap Sizing [Yang+:ISMM04] VM/OS BC [Hertz+:PLDI05] 8/20/2019 ISMM'06
27
Conclusion Garbage collection complicates the the relationship between performance and memory We propose an adaptive memory management control scheme Hides the complexity Achieves close to best possible performance 8/20/2019 ISMM'06
28
Future Work PAMM is selfish since processes use only their own observation of states How to make multiple parallel processes cooperate? Share their observations and make global decisions 8/20/2019 ISMM'06
29
Thanks 8/20/2019 ISMM'06
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.