title: Mogrify using too much memory
link: http://jj.isgeek.net/2011/05/mogrify-using-too-much-memory/
author: Jj
description: 
post_id: 712
date: 2011/05/22 16:58:16
created_gmt: 2011/05/22 21:58:16
comment_status: open
slug: mogrify-using-too-much-memory

I wanted to shrink pictures a folder with thousands of files. They were unnecessarily huge. So I made a [script to resize them](https://gist.github.com/985936). 

Imagemagick's `mogrify` takes all the RAM it can in the system to handle huge files, making the system unusable. Luckily it has a `-limit` option so it behaves. Use it like this 
    
    
    
    
    
    
    mogrify -limit memory 32 -limit map 32 -thumbnail 12801280 -quality 70 filename.ext