add memory management
mem_manage can be done in 4kB block