• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Error - memory allocation failed while rebuilding thumbnails

Maxxamillion

New Member
AMS
May i ask what this means when i try to rebuild the thumbnails

memory allocation failed `/home/thegamer/public_html/internal_data/temp/Ams_5Hdb2L' @ error/gif.c/WriteGIFImage/1623

  1. Imagick->writeimage() in NFLJ/AMS/Helper/Image.php at line 293
  2. NFLJ_AMS_Helper_Image->resize() in NFLJ/AMS/Deferred/Thumbnail.php at line 72
  3. NFLJ_AMS_Deferred_Thumbnail->execute() in XenForo/Model/Deferred.php at line 295
  4. XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 429
  5. XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 374
  6. XenForo_Model_Deferred->run() in XenForo/ControllerAdmin/Tools.php at line 159
  7. XenForo_ControllerAdmin_Tools->actionRunDeferred() in XenForo/FrontController.php at line 351
  8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  9. XenForo_FrontController->run() in /home/xxxx/public_html/admin.php at line 13
 
memory allocation failed
It means your server ran out of memory while Imagick was attempting to write a GIF (which is probably a HUGE file that your server can't process). Your server might not be beafy enough to create animated thumbs from very large LARGE files.

Maybe try and reduce the amount of items being processed at once. Default is 10, maybe cut that in half and see if that helps (I doubt it will, but its worth a shot to at least try it).

Selection_091.png

AMS does have user group permissions that you can set the max upload size for images which prevents things like this from happening.

Selection_088.png


There is also an AMS option that you need to set based on your SERVER limitation (upload_max_filesize in php.ini) that controls the MAX when you set "iunlimited" for the max file size on permissions.

Selection_089.png
 
out of curiousity, how large (file size) is that GIF image? (if you are not sure which one it is, no biggy).
not a clue, i don't know of any gif images that are used, also it does the rebuild now but gives me a 503 error page oh and now is giving me the same error code as i posted previously :(
 
also i looked in my ftp and cant find the AMS_HLV0oI file??

memory allocation failed `/home/thegamer/public_html/internal_data/temp/Ams_HLV0oI' @ error/gif.c/WriteGIFImage/1623
 
also i looked in my ftp and cant find the AMS_HLV0oI file??
the HLV0oI is the name of the IMAGE file (as it was named on the device that uploaded the file). Ams_ is appended to it during the create process.

/internal_data/temp/ directory is used for storing the TEMP file that is being created. As soon as its created, its moved into the appropriate thumbnail directory.

The issue is Imagick running out of MEMORY which your server controls. You are going to have to have your Sys Admin up the memory allocation on your server.
 
the HLV0oI is the name of the IMAGE file (as it was named on the device that uploaded the file). Ams_ is appended to it during the create process.

/internal_data/temp/ directory is used for storing the TEMP file that is being created. As soon as its created, its moved into the appropriate thumbnail directory.

The issue is Imagick running out of MEMORY which your server controls. You are going to have to have your Sys Admin up the memory allocation on your server.
I currently have 512mb
 
i don't know of any gif images that are used
The IMAGE that is causing this error has a .gif extension (which means its a GIF). There are functions that check the extension type which is used to determine which function to use to create and save the thumbnail. In this case, the file (the uploaded full size image) is a .gif and therefor it uses the below function to process the thumbnail

The $imageSaveFunc type is set to "ImageGIF" since the full size image file is a .gif. So this IF statement comes into play because the file is a GIF and you have ImageMagick installed and its not import mode.

Here is the function in play.

PHP:
        if ($imageSaveFunc == 'ImageGIF' && $this->_imageMagick && !$this->importMode)
        {
            $image = new Imagick($this->_image);
            $image = $image->coalesceImages();

            foreach ($image AS $frame)
            {
                $frame->cropImage($max_width, $max_height, $srcX, $srcY);
                $frame->thumbnailImage($newImage_width, $newImage_height);
                $frame->setImagePage($frame->getImageWidth(), $frame->getImageHeight(), 0, 0);
            }

            if ($options->amsAnimatedThumbnails)
            {
                @set_time_limit(120);

                try
                {
                    $image->writeImages($this->tmpFile, true);
                }
                catch (Exception $e)
                {
                    $image->writeImage($this->tmpFile);
                }
            }
            else
            {
                $image->writeImage($this->tmpFile);
            }

            $this->_setNewMainImage($this->tmpFile);

            $image->clear();
            $image->destroy();

            return true;
        }

This routine checks to see if you have the "Create animated thumbnails" checked (which I can tell you don't because its failing on line 293 which the ELSE part of this IF statement.

PHP:
            if ($options->amsAnimatedThumbnails)
            {
                @set_time_limit(120);

                try
                {
                    $image->writeImages($this->tmpFile, true);
                }
                catch (Exception $e)
                {
                    $image->writeImage($this->tmpFile);
                }
            }
            else
            {
                $image->writeImage($this->tmpFile);
            }

Bob, this is on my server. There is 512MB allocated to PHP already.
That SHOULD be more than enough, but obviously isn't because there is a memory allocation error.

Can you BUMP it up to see if it will at least allocate engough for ImageMagik to process this GIF file.
 
this has also prevented me from rebuilding any caches as when i click rebuild site indexs i get this error now as well, i even turned the addon off and still now get this error :S
 
this has also prevented me from rebuilding any caches as when i click rebuild site indexs i get this error now as well, i even turned the addon off and still now get this error :S
Once you start a deferred process, that process will remain in the deferred table and will be envoked any time another deferred process is initiated (and they run in order, so if one is stuck, it will need to be manually cleared). Have MATT W clear the Deferred Table for you. Do not attempt to run the AMS Thumbnail rebuilds until Matt asks you to give it another try.
 
I've increased the memory allocation to 1gb

EDIT. it's still erroring. I'm not going to allocate more than 1gb of memory to rebuild a gif on shared hosting.
 
Once you start a deferred process, that process will remain in the deferred table and will be envoked any time another deferred process is initiated (and they run in order, so if one is stuck, it will need to be manually cleared). Have MATT W clear the Deferred Table for you. Do not attempt to run the AMS Thumbnail rebuilds until Matt asks you to give it another try.
ok, ill wait
 
ok, ill wait
Matt is on Vacation, so any Sys Admin type tasks are going to need to wait until he is back on the clock.

You also need some Database related tasks performed, one of which would be to truncate the deferred table so that the stuck rebuild process is cleared which will allow others to be processed. If you can get me phpMyAdmin access, I can do that for you. I can also run a query against the xf_attachment and xf_attachment_data tables to fetch all GIF attachments for AMS. This will give me a list of Article Id's that have any GIF attachments (which you can then edit those articles and remove any large GIF attachments).
 
Back
Top