do not allocate huge memory size on saving file to disk