没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Object-Relative Addressing: Compressed Pointers in 64-Bit Java Virtual MachinesKris Venstermans, Lieven Eeckhout, and Koen De BosschereELIS Department, Ghent University, Belgium {kvenster,leeckhou,kdb}@elis.UGent.beAbstract. 64-bit address spaces come at the price of pointers requiring twice as much memory as 32-bit address spaces, resulting in increased memory usage.This paper reduces the memory usage of 64-bit pointers in the context of Java virtual machines through pointer compression, called
资源推荐
资源详情
资源评论
Object-Relative Addressing:
Compressed Pointers in 64-Bit Java Virtual Machines
Kris Venstermans, Lieven Eeckhout, and Koen De Bosschere
ELIS Department, Ghent University, Belgium
{kvenster,leeckhou,kdb}@elis.UGent.be
Abstract. 64-bit address spaces come at the price of pointers requiring twice as
much memory as 32-bit address spaces, resulting in increased memory usage.
This paper reduces the memory usage of 64-bit pointers in the context of Java
virtual machines through pointer compression, called Object-Relative Addressing
(ORA). The idea is to compress 64-bit raw pointers into 32-bit offsets relative
to the referencing object’s virtual address. Unlike previous work on the subject
using a constant base address for compressed pointers, ORA allows for applying
pointer compression to Java programs that allocate more than 4GB of memory.
Our experimental results using Jikes RVM and the SPECjbb and DaCapo
benchmarks on an IBM POWER4 machine show that the overhead introduced
by ORA is statistically insignificant on average compared to raw 64-bit pointer
representation, while reducing the total memory usage by 10% on average and up
to 14.5% for some applications.
1 Introduction
In our recent work [1], we reported that Java objects increase by 40% in size when
comparing 64-bit against 32-bit Java virtual machines. About half of this increase comes
from the increased header which doubles in size. The other half comes from increased
object fields containing pointers or references.
Running 64-bit Java virtual machines can thus be costly in terms of memory usage.
This is a serious concern on heavy-loaded systems with many simultaneously running
programs that are memory-intensive. In fact, overall system performance can quickly
deteriorate because of memory page swapping once physical memory gets exhausted.
One way of dealing with the excessive memory usage on 64-bit systems is to have more
physical memory in the machine as one would provide on a 32-bit system. However,
this is costly as physical memory is a significant cost in today’s computer systems.
This paper proposes to address the increased memory usage in 64-bit Java virtual
machines through Object-Relative Addressing (ORA). Object-relative addressing is a
pointer compression technique that compresses pointers in object fields as 32-bit off-
sets relative to the current object’s address. The 64-bit virtual address of the referenced
object is then obtained by adding the 32-bit offset to the 64-bit virtual address of the
referencing object. In case the referenced object is further away than what can be rep-
resented by a 32-bit offset, object relative addressing interprets the 32-bit offset as an
index in the Long Address Table (LAT) that translates the 32-bit offset into a 64-bit
virtual address.
E. Ernst (Ed.): ECOOP 2007, LN 4609, pp. 79–100, 2007.
c
Springer-Verlag Berlin Heidelberg 2007
CS
80 K. Venstermans, L. Eeckhout, and K. De Bosschere
The advance of object-relative addressing over prior work on the subject by Adl-
Tabatabai et al. [2], is that object-relative addressing is not limited to Java programs
that consume less than 4GB of heap, or the 32-bit virtual address space. Object-relative
addressing enables pointer compression to be applied to all Java programs, including
Java programs that allocate more than 4GB of memory.
We envision that object-relative addressing is to be used in conjunction with a mem-
ory management strategy that strives at limiting the number of inter-object references
that cross the 32-bit address range. Crossing the 32-bit address range incurs overhead
because the LAT needs to be accessed for retrieving the 64-bit address corresponding to
the 32-bit offset. Limiting the number of LAT accesses thus calls for a memory allocator
and garbage collector that strives at allocating objects within a virtual memory region
that is reachable through the (signed) 32-bit offset. Such memory allocators and garbage
collectors can be built using techniques similar to object colocation [3], connectivity-
based memory allocation and collection [4,5], region-based systems [6], etc.
The experimental results using the SPECjbb2000 and the DaCapo benchmarks and
the Jikes RVM on an IBM POWER4 machine show that object-relative addressing does
not incur a run time overhead. Some applications experience a performance improve-
ment up to 4.0% while other applications experience a slowdown of at most 3.5%; on
average though, no statistically significant performance impact is observed. The benefit
of ORA comes in terms of memory usage: the amount of allocated memory reduces by
10% on average and for some applications up to 14.5%.
This paper is organized as follows. After having discussed prior work in object
pointer compression in section 2, we will present object-relative addressing in section 3.
Section 4 will then detail our experimental setup. The evaluation of ORA in terms of
overall performance, memory hierarchy performance and memory usage will be pre-
sented in section 5. Finally, we will discuss related work in section 6 before concluding
in section 7.
2 Object Pointer Compression: Prior Work
The prior work on the subject by Adl-Tabatabai et al. [2] propose a straightforward
compression scheme for addressing the memory usage in 64-bit Java virtual machines.
They represent 64-bit pointers as 32-bit offsets from a base address of a contiguous
memory region. Dereferencing or decompressing a pointer then involves adding the
32-bit offset to a base address yielding a 64-bit virtual addess. Reverse, compressing a
64-bit virtual address into a 32-bit offset requires substracting the 64-bit address from
the base address; the lower 32 bits are then stored. A similar approach was proposed by
Lattner and Adve [7] for compressing pointers in linked data structures.
The fact that 64-bit virtual addresses are represented as 32-bit offsets from a base
address implies that this pointer compression technique is limited to Java programs
that consume less than 4GB of storage. If a Java program allocates more than 4GB
of memory, the virtual machine has to revert to the 64-bit pointer representation. This
could for example be done by setting the maximum heap size through a command line
option: if the maximum heap size is larger than 4GB, uncompressed pointers are used;
if smaller than 4GB, compressed pointers are used.
Object-Relative Addressing 81
Adl-Tabatabai et al. apply their pointer compression method to both vtable pointers
and pointers to other Java objects, so called object references. The 32-bit object refer-
ences are then relative offsets to the heap’s base address; the 32-bit vtable pointers are
relative offsets to the vtable space’s base address.
In this paper, we focus on compressing object references and do not address vtable
pointer compression. The reason is that vtable pointers are not that big of an issue when
it comes to pointer compression. The 32-bit vtable pointer offsets are highly likely to
be sufficient even for programs that allocate very large amounts of memory; it is highly
unlikely to require more than 4GB of memory for allocating vtables. In other words, the
pointer compression method by Adl-Tabatabai et al. is likely to work properly when ap-
plied to vtable pointers. Moreover, recent work by Venstermans et al. [8] has proposed a
technique that completely eliminates the vtable pointer from the object header through
typed virtual addressing. We also refer to the related work section of this paper for a
discussion on object header reduction techniques.
3 Object-Relative Addressing
Object-Relative Addressing (ORA) is a pointer compression technique for 64-bit Java
virtual machines that does not suffer from the 4GB heap limitation in Adl-Tabatabai
et al.’s method. The goal of ORA is to enable heap pointer compression for all Java
programs, even for programs that allocate more than 4GB of memory.
3.1 Basic Idea
Figure 1 illustrates the basic idea of object-relative addressing (ORA) and compares
ORA against the traditional way of referencing objects in 64-bit Java virtual machines.
We call the referencing object the object that contains a pointer in its data fields. The
object being referenced is called the referenced object. ORA references objects through
32-bit offsets. The ‘fast’ decompression path then adds this 32-bit offset to the refer-
encing object’s virtual address for obtaining the virtual address of the referenced object.
object address
object address
+
64-bit virtual address
32-bit offset
object header object fields
(a) 64-bit object addressing (b) object-relative addressing
fast path
slow path
Long Address Table
referencing
object
referenced
object
32
32
64
64
64
64
64
64
Fig.1. Illustrating the basic idea of object-relative addressing (on the right) compared against the
traditional 64-bit addressing (on the left)
82 K. Venstermans, L. Eeckhout, and K. De Bosschere
read 32-bit object reference;
if (least significant bit of 32-bit reference is NOT set) {
/
*
fast decompression path
*
/
add 32-bit object reference to 64-bit object
virtual address to form 64-bit object address;
}
else {
/
*
slow decompression path
*
/
index LAT for reading 64-bit object address;
}
Fig.2. High-level pseudocode for decompressing 32-bit object references
This is the case when both the referencing object and the referenced object are close
enough to each other so that a 32-bit offset is sufficiently large. In case both objects are
further away from each other in memory than what can be addressed through a 32-bit
offset, ORA follows the ‘slow’ decompression path. The 32-bit offset is then consid-
ered as an index into the Long Address Table (LAT) which holds 64-bit virtual addresses
corresponding to 32-bit indexes.
The end result of object-relative addressing is that only 32 bits of storage are required
for storing object references. This reduces the amount of memory consumed compared
to the traditional way of storing object references which requires 64 bits of storage.
We now go through the details of how ORA can be implemented. We discuss (i) how
pointers are decompressed, (ii) how to compress pointers, (iii) how to deal with null
pointer representation, (iv) how to manage the LAT, (v) what the implications are for
garbage collection, (vi) how ORA compares to Adl-Tabatabai et al.’s method in terms
of anticipated runtime overhead, and finally (vii) what the implications are for memory
management.
3.2 Decompressing Pointers
Decompressing 32-bit object references requires determining whether the fast or slow
path is to be taken. This is done at runtime by inspecting the least significant bit of the
32-bit offset; in case the least significant bit is zero, the fast path is taken; otherwise, the
slow path is taken. This is illustrated in Figure 2 showing the high-level pseudocode for
decompressing 32-bit object references into 64-bit virtual addresses.
The way how the high-level pseudocode is translated into native machine instruc-
tions has a significant impact on overall performance. And in addition, efficient pointer
decompression is likely to result in different implementations on platforms with dif-
ferent instruction-set architectures (ISAs). For example, in case predicated execution is
available in the ISA [9], a potential implementation could predicate the fast and slow
paths. Or, in case a ‘base plus index plus offset’ addressing mode is available in the
ISA, computing the address of an object field being accessed in the referenced object
could be integrated into a single memory operation, i.e., the decompression arithmetic
could be combined with the field access. The referencing object’s virtual address plus
剩余21页未读,继续阅读
资源评论
weixin_38688906
- 粉丝: 12
- 资源: 904
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功