Page 2 of 3

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-20T08:05:59-07:00
by magick
Recommended practices is to call MagickWandGenesis() before you fire off any threads. Once the threads complete, call MagickWandTerminus(). ImageMagick is designed to run properly if Genesis()/Terminus() is not called, but its not recommended practice.

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-26T17:31:31-07:00
by ArunKumar
I'm Getting "Killed" as Error when I performed resize operation with 50 & above Images (Each Image size vary from 1-5MB) with MultiThread Concept in Java

Can AnyOne Help Whether the "Killed" ouput occur from the ImageMagick ?

If Its is not from ImageMagick side then I will think in other perspective

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-26T19:02:20-07:00
by magick
Killed likely means you are exceeding the memory limits of the Java program or process. Try limiting memory with a MagickCore method or with an environment variable. See MAGICK_MEMORY_LIMIT @ https://imagemagick.org/www/script/reso ... nvironment.

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-26T19:59:36-07:00
by ArunKumar
How to Limit the memory with MagickCore method ?

I set MAGICK_MEMORY_LIMIT=100MB Still Its Not Working?

Upto How Much MB I can set the Limit for MAGICK_MEMORY_LIMIT Environment variable

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-26T21:33:31-07:00
by fmw42
Try changing the value in your policy.xml file. See https://imagemagick.org/script/resources.php

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-27T01:36:20-07:00
by ArunKumar
what is the Maximum size I can set for MAGICK_MEMORY_LIMIT Environment variable?

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-27T01:44:39-07:00
by ArunKumar
fmw42 wrote:
2020-03-26T21:33:31-07:00
Try changing the value in your policy.xml file. See https://imagemagick.org/script/resources.php
....

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-27T02:59:33-07:00
by magick
See the ImageMagick architecture overview @ https://imagemagick.org/script/architecture.php. To prevent excessive memory usage, limit it, and ImageMagick will push the pixel cache to disk, reducing memory requirements, with a small performance penalty.

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-29T05:22:05-07:00
by ArunKumar
I used MAGICK_MEMORY_LIMIT environment varaible to set the memory
I set MAGICK_MEMORY_LIMIT=1000MB in my bashrc file
when I checked with command identify -list resource the memory is updated

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-29T05:45:50-07:00
by snibgo
All limits add restrictions. That is, any limit you set will make the resource more limited. If anything limits you to 4 threads, then adding a limit of 6 threads will change nothing.

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-29T07:38:54-07:00
by ArunKumar
snibgo wrote:
2020-03-29T05:45:50-07:00
All limits add restrictions. That is, any limit you set will make the resource more limited. If anything limits you to 4 threads, then adding a limit of 6 threads will change nothing.
I did not understand your response.I'm not asking why is not working Im asking why it is not updated the value.Since I used MAGICK_THREAD_LIMIT environment varaible to set the thread value. But the value is not changed

My question is I used MAGICK_MEMORY_LIMIT environment varaible to set the memory .I checked Whether the MAGICK_MEMORY_LIMIT is updated or not with
identify -list resource
terminal command and the memory is updated.

But When I used MAGICK_THREAD_LIMIT environment varaible to set the thread .I checked Whether the MAGICK_THREAD_LIMIT is updated or not with
identify -list resource
terminal command and the thread value is not updated why?

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-29T08:25:57-07:00
by snibgo
Something limits your threads to 4. You can reduce this with MAGICK_THREAD_LIMIT=3 or MAGICK_THREAD_LIMIT=2. But you can't increase it, relax the limitation, with MAGICK_THREAD_LIMIT=6 or any number larger than 4.

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-29T08:59:01-07:00
by ArunKumar
Yes your correct I was able to decrease the thread limit & not able to increase the limit
But why such limit ..
Are there any reason that Im not able to increase the thread?

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-29T09:11:25-07:00
by snibgo
How many cores does your CPU have?

Re: problem during executing MagickWand resize method parallel (MultiThread)

Posted: 2020-03-29T19:56:05-07:00
by ArunKumar
My CPU details