Fix alloc too much mem