Page 1 of 2

Multiple copies of "convert" in memory

Posted: 2012-04-14T11:20:57-07:00
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)

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:32:40-07:00
by fmw42
What was your command? Was it in a script?

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:35:36-07:00
by fmw42
run

type -a convert

and see if you have multiple version of IM at the same location.

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:36:26-07:00
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

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:41:49-07:00
by gregory
Do you need any additional information?

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:45:22-07:00
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!

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:46:34-07:00
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()?

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:48:03-07:00
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!

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:49:14-07:00
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.

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:50:31-07:00
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.

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T11:52:22-07:00
by gregory
Where I can find advanced help? You mean, wait for someone here?

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T12:03:16-07:00
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.

Re: Multiple copies of "convert" in memory

Posted: 2012-04-14T12:06:50-07:00
by gregory
I tried to reinstall IM with "--disable-openmp" but that didn't do the trick.

Re: Multiple copies of "convert" in memory

Posted: 2012-04-16T08:59:31-07:00
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.

Re: Multiple copies of "convert" in memory

Posted: 2012-04-16T10:28:44-07:00
by fmw42