Selective Main Memory Compression by identifying Program Phase Changes
Doron Nakar and Shlomo Weiss
Tel Aviv University
Reported by jiang
Background
During a program’s runtime, the stack and data segments of the main memory often contain much redundancy. Compress these memory can offer obvious benefits of increasing the overall memory availability and reducing disk accesses.
Background
•Work by this paperPresents a new approach to compress memory selectively by not compressing all the memory all of the time.Identify the working Sets which exhibit good spatial locality, and leave it uncompressed for faster access.
4
Main Idea
The runtime program is divided into windows of fixed size.After a window finishes executing, the segments executed will be hashed in to a array by setting the corresponding bit to ‘1’.
Seg 0
Seg 1
.
.
.
Seg k
Bit 0
Bit 1
.
.
.
Bit n
Instructions window Hash Array
.
Main Idea
•Then the current hash array will be compared with previous array to get a difference factor δ .
=
•Lower δ value means less difference, as well as better locality, which means contain much redundancy to compress.
•Pages that are in the program’s page table but not in its working set is the candidate to be compressed.
Flowchart
Run “Window size” instructionsmark the hash array
record segment address
Calculate δ
δ small enough ?
Replace previous table to current
Trigger compression
Clear current table
Locality algorithm evaluation
A surprise occurs when if neither bit is on or if the address stored in the current hash table doesn’t match the requested address. More surprises mean less spatial locality.
Locality algorithm evaluation
“gzip” allocates and clears 60 Mbytes of space on the heap but never uses it. And it causes abnormally high compression ratios due to many pages that contain only zeros.
we had to disregard pages that contain only zeros and not take them into account in the compression results.
9
Compression method
• Hash array can be compared to get the locality ratio, however ,to get the addresses accessed, we need expand hash array by adding additional information to determine, during a stable phase of the program, which pages are unused and may be compressed.
Bit 0
Bit 1
.
.
.
Bit n
.
Expand
Bit 0
Bit 1
.
.
.
Bit n
.
Address
Address
.
.
.
Address
.
Compression method
• Compressing all the pages that are in the program’s page table but not in its working set(hash table).
0
1
1
.
.
0.
Null
Address
Address
.
.
Null.
Not to be compressed!
PERFORMANCE RESULTS
1. At the end of every instruction window: the compression ratio is calculated.
2. The percentage of memory in compressed form.
3. The number of decompressed pages per instruction window
PERFORMANCE RESULTS
eon: Average δ Value is 0.0760
crafty: Average δ Value is 0.0200
Thanks for your appreciation!