| CPC G06F 3/0655 (2013.01) [G06F 3/0604 (2013.01); G06F 3/0679 (2013.01)] | 12 Claims |

|
1. A method for memory compression by a memory device having a memory controller, the method comprising:
receiving, at the memory controller and from a central processing unit (CPU), a read request for reading data from a memory, the memory being divided into a plurality of segments, one of the plurality of segments being divided into a plurality of sub-segments, one of the plurality of sub-segments being compressed into one or more blocks, and the read request is for reading data from a sub-segment of a segment in the memory;
determining, in the segment, an entry corresponding to the sub-segment based on an interleaved mapping rule that uses last bits of a paragraph address as an index of the entry to ensure successive paragraphs are widely distributed, the entry comprising an indicator;
determining a block storing compressed data that contains the requested data identified in the read request based on the indicator in the entry, wherein the indicator comprises a plurality of pointers, and wherein a maximum number of pointers in the entry is determined based on a first ratio between a size of one sub-segment and a size of one block, and a size of one pointer in the entry is determined based on a second ratio between a size of one segment and a size of one block; and
accessing the determined block to retrieve the compressed data, decompressing the compressed data, and providing the decompressed data to the CPU in response to the read request.
|