Knowledge engineering: from people to machines and back
Selective main memory compression by identifying program phase
1. Selective Main Memory Compression by
identifying Program Phase Changes
Doron Nakar and Shlomo Weiss
Tel Aviv University
Reported by jiang
2. 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.
3. Background
•Work by this paper
Presents 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. 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
A
r
r
a
y
.
5. 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.
6. Flowchart
Run “Window size” instructions
mark the hash array
record segment address
Calculate δ
δ small
eno
ugh
?
Replace previous table to current
Trigger compression
Clear current table
7. 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.
8. 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. 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
.
10. 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!
11. 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