Intelligent cache management for heterogeneous memory systems