Application-specific memory management for embedded systems using software-controlled caches