Nonvolatile Main Memory Aware Garbage Collection in
High-Level Language Virtual Machine
Chen Pan
1
, Mimi Xie
1
, Chengmo Yang
2
, Zili Shao
3
, and Jingtong Hu
1
1
School of Electrical and Computer Engineering, Oklahoma State University, Stillwater, OK, 74078, USA.
2
Department of Electrical and Computer Engineering, University of Delaware, Newark, DE, 19716, USA.
3
Department of Computing, The Hong Kong Polytechnic University, Hung Hom, Hong Kong.
{chen.pan,mimix,jthu}@okstate.edu, chengmo@udel.edu, cszlshao@comp.polyu.edu.hk
ABSTRACT
Non-volatile memories (NVMs) such as Phase Change Mem-
ory (PCM) have been considered as promising candidates of
next generation main memory for embedded systems due to
their attractive features. These features include low power,
high density, and better scalability. However, most exist-
ing NVMs suffer from two drawbacks, namely, limited write
endurance and expensive write operation in terms of both
time and energy. These problems are worsen when modern
high-level languages employ virtual machine with garbage
collector that generates a large amount of extra writes on
non-volatile main memory. To tackle this challenge, this pa-
per proposes three techniques: Living Objects Remapping
(LORE), Dead Object Stamping (DOS), and Smart Wip-
ing with Maximum Likelihood Estimation (SMILE) to re-
duce the unnecessary writes when garbage collector handles
objects. The experimental results show that the proposed
techniques not only significantly reduce the writes during
each garbage collection cycle but also greatly improve the
performance of virtual machine.
1. INTRODUCTION
Non-volatile memories (NVMs) such as Resistive Ran-
dom Access Memory (RRAM) [22, 21, 9] and Phase Change
Memory (PCM) [11, 13, 19, 23], have many attractive fea-
tures for embedded systems to employ them as main mem-
ory. Those features include ultra low leakage power, high-
density, better scalability, non-volatility, and high immunity
to soft errors, which enable embedded systems to achieve
longer battery life, large memory capacity, and better re-
liability. However, NVMs also suffer from two drawbacks:
limited write endurance and expensive write operation in
terms of time and energy.
These problems will become even worse when high-level
programming language are used to develop embedded ap-
plications [2, 12, 16]. High-level languages, such as Java
and Python, enable fast application development. However,
these programming languages need underlying High-Level
.
Language Virtual Machine (HLVM) [20, 4] support. H-
LVMs ease the application development by taking care of
the runtime memory management. One of the main func-
tions of HLVMs is garbage collection (GC) [10, 17, 5], which
is responsible for recycling unused heap memory to reduce
both memory fragmentation and the risk of triggering “out
of memory” error. During GC, memory contents in the heap
will be moved frequently and a large number of writes will
be generated on the main memory. Without any optimiza-
tion, the massive extra writes generated by the HLVMs will
worsen the situation of NVMs when they are adopted as
main memory for embedded systems.
To avoid this undesirable situation, this paper focuses on
reducing the number of writes on non-volatile main memo-
ry (NVMM) generated by the garbage collector in HLVM.
To the best of our knowledge, this is the first work that
considers the effect of HLVM on NVMM due to the extra
writes caused by GC. In particular, we propose NVM-aware
GC, a non-volatile main memory aware garbage collection,
composed of three techniques that can be incorporated in
high level language virtual machine to improve its NVMs
friendliness. These three techniques are:
1) A Living Objects Remapping (LORE) algorithm that
eliminates the write operations on NVMM when GC
moves objects;
2) A Dead Objects Stamping (DOS) algorithm that re-
duces write operations by reserving the unused heap
memory instead of releasing it to the operating system
(OS);
3) A Smart Wiping with Maximum Likelihood Estima-
tion (SM ILE) algorithm that estimates the amount
of memory space needed to be released back to OS
based on maximum likelihood estimation. It balances
the NVMM lifetime extension and system performance
overhead.
Out work is based on the popular Generational Mark and
Sweep [10] garbage collection. However, the proposed tech-
niques can also be easily extended to other GCs. Experimen-
tal studies show that the proposed NVM-aware GC gener-
ates 40% less write operations compared with the tradition-
al Generation Mark
Sweep, thus making it more suitable for
NVMM with constrained lifetime.
The rest of the paper is organized as follows. Section 2
gives a brief introduction of the background and related
work. Section 3 illustrates the main ideas with a motiva-
tional example. In Section 4, the three proposed techniques
LORE, DOS, and SM ILE are introduced one by one. Ex-
perimental results are presented in Section 5. Finally, Sec-
978-1-4673-8079-9/15/$31.00 ©2015 IEEE 197