1. A method for improving performance of a systems running a platform-independent program, comprising: receiving a first code; compiling the first code to a second code; and performing priority-based code cache management (CCM) to ensure there is enough memory space in a code cache for the second code.