Minimizing Cache Usage for Real-time Systems