Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans, Lieven Eeckhout, Koen De Bosschere Department of Electronics and Information Systems Ghent University - Belgium 21st European Conference on Object-Oriented Programming July 30 – August 3, Berlin, Germany
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 2 Objects have different sizes in 32-bit and 64-bit mode 32-bit : 64-bit : ref 1 alignment ref 1 int 1 class Example { int int 1 ; Example ref 1 ; }
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 3 Prior work 64-bit Pointer compression techniques: Adl-Tabatabai et al. Improving 64-bit Java IPF performance by compressing heap references. At CGO Lattner and Adve. Transparent pointer compression for linked data structures. At MSP bit Pointer compression technique: Zhang and Gupta. Data compressing transformations for dynamically allocated data structures. In Computational Complexity 2002.
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 4 Referencing objects are often located close to each other heap: 0x x x relative offset: ro 1 = ref 1 – ref 0 ro 1 ref 0 ref 1 0x0
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 5 Object-Relative Addressing: goal 32-bit : 64-bit : ref 1 ORA : ro 1 ref 0 ref 1 = ref 0 + ro 1
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 6 What if some referencing objects aren’t located close to each other? Long Address Table (LAT): referentie 0 … 012…n012…n 64 bits old object reference field: 630 reference new object reference field: 310 rel.offset0 310 index1 Check at compression time ! heap: ?
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 7 read 64-bit reference from LAT ref 1 = ref 0 + ro 1 bit 0==0 ? yes no Decompression requires extra test ro 1 ref 0 read ref 1 : read 32-bit relative offset next instruction read 32-bit relative offset ref 1 = ref 0 + ro 1 next instruction Jump to read 64-bit reference from LAT ref 1 = ref 0 + ro 1 bit 0==0 ? yes no
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 8 Rebuilding the Long Address Table 0x x x relative offset: ref 0 ref 1 nursery LAT: reference 0 … 012…012… mature LAT: reference m … m m+1 m+2 … new mature LAT: reference k … k k+1 k+2 …
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 9 0x Compressing the null-reference - 32 least significant bits zero after decompression 0x zero bits - through LAT: 0x AAA 0xFFFF F556 0x null … 012…012… +
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 10 Experimental setup 64-bit Jikes RVM, version IBM Power4, AIX benchmarks: dacapo (beta ) pseudojbb2000
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 11 On average, ORA reduces 10% of total allocated bytes
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 12 On average, ORA has no significant impact on performance antlr bloat fop hsqldb jython pmd pseudojbb avg speedup
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 13 We envision ORA to be used with a smart MM strategy Try to limit the number of inter-object references that cross the 32-bit address range using techniques such as: Object colocation ( Guyer and McKinley, OOPSLA 2003) Connectivity-based memory allocation and collection (Hirzel et al, OOPSLA 2003) Region-based systems ( Cherem and Rugina, ISMM 2002; Qian and Hendren, ISMM 2002; Hallenberg et al, PLDI 2002) …
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 14 Conclusions 64-bit mode uses a lot more memory than 32-bit mode ORA reduces allocated bytes by 10%, and up to 14,5% ORA does not give up on performance
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 15 … and next? we should rethink about how to use the 64-bit virtual address space: not efficient to look at it as just one linear blok better to give a functional meaning: encode information, make regions based on age, connectivity, … construct smart memory managers fast analysis: points-to, escape, pointer interference preferably (partially) at runtime
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 16 Questions ?
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 17 Extra: L3 misses
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 18 Extra performance measurements antlr bloat fop hsqldb jython pmd pseudojbb avg
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 19 Extra performance measurements db jack javac jess antlr fop hsqldb pmd crypt heapsort lufact moldyn search sor sparse pseudojbb avg
Object-Relative Addressing: Compressed Pointers in 64-bit Java Virtual Machines Kris Venstermans – Aug. 1 st 2007 – ECOOP 2007, Berlin pag. 20 Extra: reduction in bytes