|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-27 15:17 UTC] mkoppanen@php.net
[2010-01-28 05:49 UTC] showerheadsuk at hotmail dot com
[2010-01-28 07:02 UTC] mkoppanen@php.net
[2010-03-01 19:17 UTC] b at turbulent dot ca
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jan 12 04:00:01 2026 UTC |
Description: ------------ When trying to limit the memory usage, it doesn't seem to have any effect. I'm running php as cgi, and monitoring the php processes memory usage with the top command. I've tried ImageMagick 6.5.4 with Imagick 2.3.0 ImageMagick 6.5.4 with Imagick 3.0.0b1 ImageMagick 6.5.9 with Imagick 3.0.0b1 But all produce the same results - massive memory usage when resizing large images. I can limit memory usage when using ImageMagick on the commandline with the '-limit memory' and '-limit map' parameters, but the Imagick setResourceLimit function seems to have no effect. Reproduce code: --------------- $thumb = new Imagick($originalImg); $thumb->setResourceLimit( Imagick::RESOURCETYPE_MEMORY, 64 ); $thumb->setResourceLimit( imagick::RESOURCETYPE_MAP, 128 ); $thumb->resizeImage(1024, 720, Imagick::FILTER_LANCZOS, 0.8, true); $thumb->destroy(); Expected result: ---------------- Memory usage stays below 128MB Actual result: -------------- Resizing 36.4MB jpeg (161MB uncompressed), the php process handling the script balloons to around 467MB (using the value from the RES column of top)