Working Set Characterization of Applications with an Efficient LRU Algorithm -- Theory