problem during executing MagickWand resize method parallel (MultiThread)

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post 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
Last edited by ArunKumar on 2020-04-28T02:07:32-07:00, edited 1 time in total.

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post 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

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Try changing the value in your policy.xml file. See https://imagemagick.org/script/resources.php

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post by ArunKumar »

what is the Maximum size I can set for MAGICK_MEMORY_LIMIT Environment variable?

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post 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
....
Last edited by ArunKumar on 2020-04-28T02:08:35-07:00, edited 1 time in total.

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post 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
Last edited by ArunKumar on 2020-04-28T02:11:46-07:00, edited 1 time in total.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post 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?

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post 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?

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

How many cores does your CPU have?
snibgo's IM pages: im.snibgo.com

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

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

Post by ArunKumar »

My CPU details
Last edited by ArunKumar on 2020-04-28T02:10:14-07:00, edited 1 time in total.

Locked