* add a global code cache * extract memory-limited lru cache to util * use memory-limited code cache * account for code cache size in mem_used