You are here: Re: help! I'm getting "out of memory" errors when trying to resize an image « PHP Programming Language « IT news, forums, messages
Re: help! I'm getting "out of memory" errors when trying to resize an image

Posted by Rik on 08/17/06 20:56

lawrence k wrote:
> I've a jpeg image that is 514k, which doesn't strike me as very large.

Well, it is 514K in compacted mode. When creating in image with GD it cen
quickly become very large.

> Yet I'm running out of error when I try to resize it:
>
> Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to
> allocate 12288 bytes) in
>
/home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/resizeImageT
oSquare.php
> on line 82
>
>
> How can I protect against out-of-memory errors?

Well, you could try to check your usage on various points in the script with
memory_get_usage(), and check what is causing it. You might be able to do things
more effeciently.

Number one protection against out-of-memory errors is descent code, but even
descent code may need more. If you truly need more memory, you should up the
memory limit.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация