1. Any of a number of methods to reduce unused or unusable space in primary, secondary, or other memory. See memory compaction.
2. Removal of redundant data from a record. Many systems work with fixed-length records as a convenient method of handling files. This has the disadvantage that all records must be capable of holding the longest record, giving uneconomic use of storage. The fixed-length records can be processed (compacted) into a variable-length form. One method involves the removal of trailing spaces; another involves the replacement of long strings of identical characters by a flag that indicates the occurrence of such a string, together with a count of the number of characters and a single instance of the character. Compaction will require CPU time when the record is stored and again when it is unpacked to fixed-length form, but the consequent saving in storage may justify this.