From a9cf918103136c9a41132db95e1b17f6a7ae512b Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Wed, 16 Mar 2016 18:35:34 +0100 Subject: [PATCH] Destroy the original image when done with resizing When re-sizing a bunch of 24 megapixels image (direct from a digital camera) into responsive images, not destroying the `img` member made my server OOM (it does not have a lot of RAM, it's a cheap VPS). Additionally, when re-generating the site, although there was no need to re-generate the images, it looked like it was still loading them up, and the GC was not kicking in so it was OOM-ing (or close to OOM-ing) as well. This fixes both issues. --- lib/jekyll/responsive_image/resize_handler.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jekyll/responsive_image/resize_handler.rb b/lib/jekyll/responsive_image/resize_handler.rb index 614ca12..b63c4db 100644 --- a/lib/jekyll/responsive_image/resize_handler.rb +++ b/lib/jekyll/responsive_image/resize_handler.rb @@ -35,6 +35,8 @@ module Jekyll i.destroy! end + + img.destroy! resized end