avoid large memory occupation