heap optimizations