fix memory size problem