Program locality analysis based on reuse intervals