Page 1 of 1

'magick-*' files increase disk space on Image::resize hang or failure

Posted: 2018-12-07T02:34:19-07:00
by Ganesh_B
Hi ImageMagick,

Our Customer has raised issue that disk space is increasing continuously in huge amounts as ‘magick-*’ temporary files in ‘C:\Windows\Temp’ are not cleaned up after failure at conversion of attached file(link below).

https://drive.google.com/open?id=1jOuSs ... G-DSvebNpZ

The attached image file(link below) conversion is hanging when opened/read using ImageMagick’s C++ ‘class MagickPPExport Image’ and when method ‘Image::resize()’ called with argument as ‘7968x10968!’ calculated for output resolution 300 Text content. This is happening even with the latest version of ImageMagick ie; ‘ImageMagick-7.0.8-12’.

Is there any facility/configuration to clean-up temporary files even after hang or failures at ImageMagick conversions. What could be the reason for hang/failure of this particular image.

https://drive.google.com/open?id=1jOuSs ... G-DSvebNpZ

Regards,
Ganesh.

Re: 'magick-*' files increase disk space on Image::resize hang or failure

Posted: 2018-12-07T06:20:19-07:00
by snibgo
What version of IM?

My guess is that you had a failure that IM couldn't recover from (perhaps out of memory), so it crashed or was killed by the OS, so didn't have a chance to delete its temporary files.

The cure is to regularly delete files in %TEMP%.

Other software also leaves files in %TEMP%. You might want to delete all files in that directory whenever you startup or shutdown.

Re: 'magick-*' files increase disk space on Image::resize hang or failure

Posted: 2018-12-09T23:44:37-07:00
by Ganesh_B
Hi
ImageMagick version is 'ImageMagick-7.0.8-12'. What is the reason for the attached image hang for several minutes( more than 60 mn) issue at method ‘Image::resize()’ called with argument as ‘7968x10968!’ ? Can there be a resolution by IM.

https://drive.google.com/open?id=1jOuSs ... G-DSvebNpZ

Regards,
Ganesh.

Re: 'magick-*' files increase disk space on Image::resize hang or failure

Posted: 2018-12-10T01:40:44-07:00
by snibgo
Your operating system contains tools to monitor memory and disk access by processes. What do they tell you? Perhaps your operation needs more memory than you have available, so IM uses disk for pixel caches. Disk is far slower than memory.

How many pixels does the input image have?

How much physical memory do you have? Perhaps you have enough, but IM isn't using it all. What does "magick list resource" say? Perhaps your policy.xml is too restrictive.

Re: 'magick-*' files increase disk space on Image::resize hang or failure

Posted: 2018-12-10T04:09:18-07:00
by magick
Read about ImageMagick architecture @ https://www.imagemagick.org/script/architecture.php. Read about large image support @ https://www.imagemagick.org/script/arch ... tera-pixel. Its likely the image size exceeds the available memory. If so, the image pixels are cached to disk which is quite slow. To speed up the process by up to 5X, IM utilizes memory-mapped IO on disk. The default disk partition is /tmp. If it fills up while being memory-mapped, a SIGBUS is thrown. IM cannot catch a SIGBUS so any temporary files it creates cannot be gracefully removed. Instead set the MAGICK_SYNCHRONIZE environment variable, see https://www.imagemagick.org/script/resources.php, which will permit IM to exit gracefully if it runs out of disk space with a slight performance penalty. Alternatively, choose a different disk partition to cache the image pixels per https://www.imagemagick.org/script/arch ... tera-pixel. Finally, consider getting a beefier host. With plenty of memory, cores, disk and fast disk, ImageMagick will perform operations in seconds rather than minutes. On our host with 32GB of memory and 8 cores, we resized your image in less than 2 seconds.

Re: 'magick-*' files increase disk space on Image::resize hang or failure

Posted: 2018-12-14T04:42:16-07:00
by Ganesh_B
Thank you for the detailed information. Sent Customer the information.