Optimization - Reducing Memory Consumption

Introduction
One can often speed up the program by reducing the memory consumption of individual data or the entire program in general. This is due to the fact that more data elements can fit in one cache line, or because the program in general consumes less memory, and so has fewer cache misses and has less overhead of swapping and paging.