Multiple copies of "convert" in memory

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
gregory
Posts: 67
Joined: 2009-08-02T17:20:23-07:00
Authentication code: 8675309

Multiple copies of "convert" in memory

Post by gregory »

Hello guys,

I tried to update IM from 6.7.1-0 to 6.7.6-5, but very soon I got a huge server's load average.
When I ran "htop" I found a very strange thing:
Image
As you can see, convert produces multiple copies of SAME command. They are absolutely same but convert runs 6-10 times for some reason.
I had to install 6.7.1-0 back but the bug didn't disappear.Thanks god I had my old IM 6.2.8 at /usr/bin/convert. I've changed path to my old IM from /usr/local/bin/convert where the new version is stored, and the problem has been solved.
Could please someone explain me what was that???? And how can I use new version of IM???
Please answer ASAP!
Thanks in advance!

P.S.: Just in case "uname -a":
Linux server.com 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:32:29 EDT 2011 i686 i686 i386 GNU/Linux (CentOS)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiple copies of "convert" in memory

Post by fmw42 »

What was your command? Was it in a script?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiple copies of "convert" in memory

Post by fmw42 »

run

type -a convert

and see if you have multiple version of IM at the same location.
gregory
Posts: 67
Joined: 2009-08-02T17:20:23-07:00
Authentication code: 8675309

Re: Multiple copies of "convert" in memory

Post by gregory »

Yes, it was inside .php script. I run "system('/usr/local/bin/convert /path/to/image.gif -resize SIZE_VALUE RESIZE VALUE /path/to/result.gif');"
As you can see on a screenshot "convert" was executed only ONCE from a script. BUT after that this convert process executed more same processes.
run

type -a convert

and see if you have multiple version of IM at the same location.
convert is /usr/local/bin/convert
convert is /usr/bin/convert
gregory
Posts: 67
Joined: 2009-08-02T17:20:23-07:00
Authentication code: 8675309

Re: Multiple copies of "convert" in memory

Post by gregory »

Do you need any additional information?
gregory
Posts: 67
Joined: 2009-08-02T17:20:23-07:00
Authentication code: 8675309

Re: Multiple copies of "convert" in memory

Post by gregory »

I made a test... I run a plain command from a shell "/usr/local/bin/convert /1.gif 100x100 /2.gif" and see THE SAME bug -- five copies of convert in memory!
Please advice!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiple copies of "convert" in memory

Post by fmw42 »

I probably cannot help much as I am not a unix guru nor a PHP expert.

But, I don't understand this command

system('/usr/local/bin/convert /path/to/image.gif -resize SIZE_VALUE RESIZE VALUE /path/to/result.gif');"

Why do you have multiple values after -resize? What is SIZE_VALUE RESIZE VALUE -- this is 3 values? Can you give me a command with actual numbers?

Have you tried using exec() rather than system()?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiple copies of "convert" in memory

Post by fmw42 »

I made a test... I run a plain command from a shell "/usr/local/bin/convert /1.gif 100x100 /2.gif" and see THE SAME bug -- five copies of convert in memory!
Please advice!
Thanks. That is much clearer. But it looks fine to me and you only have two versions of IM as seen by your type -a convert. So I don't know what to advise at this point. You will need more advanced help than I can give. Sorry.

Edit:

However,

/usr/local/bin/convert /1.gif 100x100 /2.gif

you left out the -resize!
gregory
Posts: 67
Joined: 2009-08-02T17:20:23-07:00
Authentication code: 8675309

Re: Multiple copies of "convert" in memory

Post by gregory »

It was just an example. You don't need to be an expert in PHP since I can reproduce this bug in a shell manually.
Here is the command: "/usr/local/bin/convert /1.gif -resize 100x100 /2.gif"
you left out -resize
I left it out only here, on forum.
Last edited by gregory on 2012-04-14T11:50:35-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiple copies of "convert" in memory

Post by fmw42 »

gregory wrote:It was just an example. You don't need to be an expert in PHP since I can reproduce this bug in a shell manually.
Here is the command: "/usr/local/bin/convert /1.gif -resize 100x100 /2.gif"
you left out -resize
It left it out only here, on forum.

As I said, it looks fine to me. You will need more advanced help than I can give. Sorry.
gregory
Posts: 67
Joined: 2009-08-02T17:20:23-07:00
Authentication code: 8675309

Re: Multiple copies of "convert" in memory

Post by gregory »

Where I can find advanced help? You mean, wait for someone here?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiple copies of "convert" in memory

Post by fmw42 »

gregory wrote:Where I can find advanced help? You mean, wait for someone here?
Yes, you will have to wait for one of the IM developers or someone else who knows more about unix than I.
gregory
Posts: 67
Joined: 2009-08-02T17:20:23-07:00
Authentication code: 8675309

Re: Multiple copies of "convert" in memory

Post by gregory »

I tried to reinstall IM with "--disable-openmp" but that didn't do the trick.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Multiple copies of "convert" in memory

Post by glennrp »

I'm used to seeing "multiple copies" of an application that I run at work (not *Magick) in the "top" display.
It's shown once per CPU; the code (and data) is really only occupying one block of shared memory.

So I guess your question is really how to defeat the multi-processing, if that's what you want. In the
application I run, there's an opportunity on the command line to specify how many processors to
use. I'm not sure if that's a feature of the code or a feature of MP linux.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Multiple copies of "convert" in memory

Post by fmw42 »

Post Reply