Subject: bug#25625: Opening djvu file eats up all my RAM

From: Noam Postavsky <[email-masked]>
Date: Thu, 07 Jun 2018 07:47:12 -0400

tags 25625 + unreproducible
quit

Antoine Levitt <[email-masked]> writes:

> Standard imagemagick from linux mint 18.1:
>
> antoine@epsilon:~$ convert --version
> Version: ImageMagick 6.8.9-9 Q16 x86_64 2016-11-29 http://www.imagemagick.org
> Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
> Features: DPC Modules OpenMP
> Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

I'm not able to reproduce the problem, I can read the file you sent
without trouble, albeit pretty slowly.  It takes about ~15s to go to the
next page, during which time I see (in top) Emacs' memory usage go up,
but it goes back down again after the page is displayed.  Perhaps the
imagemagick version is the problem?

~$ convert --version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND   
23078 npostavs  20   0 1390832 831836 535952 D  42.9 20.9   2:08.71 emacs //{while going to next page}
23078 npostavs  20   0  679200 120040  26632 S   0.0  3.0   2:21.38 emacs //{after page is displayed}

By the way (sorry I forgot to suggest this before asking you to retest)
if you use ulimit to cap virtual mem at say 2GB 'ulimit -v $((2 * 1024
1024))' does Emacs give you an out of memory error instead of crashing
your system?