Memory Allocation failed

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.
tuanng
Posts: 8
Joined: 2017-08-03T19:34:48-07:00
Authentication code: 1151

Memory Allocation failed

Post by tuanng »

Hello all

Im running the command below

Code: Select all

convert -background transparent -fill "#FFFF3D" -stroke red -strokewidth 1  -font "fonts/impact.ttf" -size 1200x600 -gravity Center -interline-spacing 0 label:ABC 123.png
and im getting the error

Code: Select all

attribute not recognized: D
convert: Memory allocation failed `' @ fatal/draw.c/DrawImage/3110.
But if I run the same command without the stroke options, it works fine.

Code: Select all

convert -background transparent -fill "#FFFF3D" -font "fonts/impact.ttf" -size 1200x600 -gravity Center -interline-spacing 0 label:ABC 123.png
Does anybody know what's going on? It was working fine for a few days then started getting this error
tuanng
Posts: 8
Joined: 2017-08-03T19:34:48-07:00
Authentication code: 1151

Re: Memory Allocation failed

Post by tuanng »

actually, taking the 'size' option out also work, but I need the 'size' option to determine text size
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Memory Allocation failed

Post by snibgo »

What version of IM? On what platform?
snibgo's IM pages: im.snibgo.com
tuanng
Posts: 8
Joined: 2017-08-03T19:34:48-07:00
Authentication code: 1151

Re: Memory Allocation failed

Post by tuanng »

Version: ImageMagick 6.5.9-10 2017-05-26 Q16 - on CENTOS 6.9 x86_64

After a bit more testing, the command with the error worked if I changed the size to 1000x500 ( larger sizes cause errors, I tried 1000x600 too)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Memory Allocation failed

Post by fmw42 »

Your system probably has file size or dimensions limitations.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Memory Allocation failed

Post by snibgo »

The IM version is very, very old. I suggest you upgrade.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Memory Allocation failed

Post by fmw42 »

snibgo wrote: 2017-08-03T22:16:37-07:00 The IM version is very, very old. I suggest you upgrade.
I learned recently, that Linux distros get patches as indicated by the date and do not change the original version number.

I suspect the policy.xml file has limitations set, assuming this is a shared server.
tuanng
Posts: 8
Joined: 2017-08-03T19:34:48-07:00
Authentication code: 1151

Re: Memory Allocation failed

Post by tuanng »

This is a dedicated server with 16GB ram
fmw42 wrote: 2017-08-03T22:17:44-07:00
snibgo wrote: 2017-08-03T22:16:37-07:00 The IM version is very, very old. I suggest you upgrade.
I learned recently, that Linux distros get patches as indicated by the date and do not change the original version number.

I suspect the policy.xml file has limitations set, assuming this is a shared server.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Memory Allocation failed

Post by fmw42 »

See if your policy.xml file has any limitations set. On my Mac IM 6.9.9.4 , it is in /usr/local/etc/ImageMagick-6. See http://www.imagemagick.org/script/resources.php and

see http://www.imagemagick.org/source/policy.xml (but you need to view it on a browser that reads xml files into text, such as chrome)

Also check your OS to see if it has any limitations set.
tuanng
Posts: 8
Joined: 2017-08-03T19:34:48-07:00
Authentication code: 1151

Re: Memory Allocation failed

Post by tuanng »

Thanks for your reply.

The policy.xml file has all those policies commented out, so I assume it's not active?

Like this..

Code: Select all

<!--
 <policy domain="resource" name="memory" value="2GiB"/> 
-->
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Memory Allocation failed

Post by snibgo »

What does "convert -list resource" say? Mine says:

Resource limits:
Width: 214.7MP
Height: 214.7MP
Area: 8.4474GP
Memory: 3.9336GiB
Map: 7.8672GiB
Disk: unlimited
File: 1536
Thread: 8
Throttle: 0
Time: unlimited


The first error message is:
tuanng wrote:attribute not recognized: D
This makes me suspect not merely a resource limitation, but something more fundamental, perhaps a bad build of IM (with some patches applied but not others).
snibgo's IM pages: im.snibgo.com
tuanng
Posts: 8
Joined: 2017-08-03T19:34:48-07:00
Authentication code: 1151

Re: Memory Allocation failed

Post by tuanng »

odd, mine didn't list same as yours, this is what I got

$ convert -list resource
File Area Memory Map Disk Thread Time
-------------------------------------------------------------------------------
768 33.363GB 23.304GiB 62.144GiB 18.446744EB 8 unlimited
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Memory Allocation failed

Post by snibgo »

Yes, that's how it used to look, perhaps more than a year or two ago. Does IM work for you at all? If not, I suggest you re-install. Preferably with a recent version of IM.
snibgo's IM pages: im.snibgo.com
tuanng
Posts: 8
Joined: 2017-08-03T19:34:48-07:00
Authentication code: 1151

Re: Memory Allocation failed

Post by tuanng »

yes it's working fine except for the memory issue.

The reason I didn't install the latest version is it messed up some commands ( I wrote them a few years ago, so probably not compatible with the new version )

I guess I'll just have to update it and then reinstall

Thanks for your help
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Memory Allocation failed

Post by snibgo »

If you do upgrade, as you have scripts etc, I suggest you upgrade to the latest v6, not v7. V7 has major changes that make porting from v6 non-trivial.
snibgo's IM pages: im.snibgo.com
Post Reply