저는 앱의 백업을 만들고 데이터베이스, 이미지, 파일 등에있는 데이터와 함께 zip 파일로 다운로드하는 기능을 가지고 있습니다. Tempfile 클래스) send_data와 함께 브라우저에 보내지 만 send_data 이후에 삭제하면 다운로드가 실패하고 메모리가 해제되지 않습니다.메모리가 해제되지 않습니다.
send_file(zip_data.path, type: 'application/zip', filename: "#{model_name}.zip")
zip_data.unlink
서비스 클래스 : http://pastebin.com/MskjP8d7
컨트롤러 방법 : http://pastebin.com/CV9Wr27h