In the forums I received very often the question :
I got the failure “Fatal error: Out of memory ” or “Error : Exceed Memory limit. Require : xx.xx MByte”, but my image has only the size of 1 MB ?
After I answered this question now 1000 times , I hope this post will clarify this point. Let’s create a white image with the size of 640 x 480 (It’s the VGA resolution) and open this with a image viewer like IrfanView.
Let’s have a look at the bottom line :

The image requires a disk space (the file size) of 5.30 KB and a memory size of 900.04 KB
Now increase the resolution to 1024 x 768 :

The image requires still the file size of 5.30 KB but a memory size of 2.25 MB
Now look for a 4 Megapixel image (Resolution 2304 x 1728) :

The required memory size increases to 11.39 MB
And a 7.1 MP camera picture :

We need now 20.25 MB memory , but the file size is still 5.30 KB.
What do we learn from this test ? JPG, PNG (and other compression format’s) reduces the file size, but for image manipulation we need for each pixel a lot of memory space:
File size is not equal to the required memory space.
Inside the most web server the common image manipulation library for PHP is called GD and this library doesn’t work different then programs like Photoshop, Paintshop or others. A very rough calculation for the memory need under GD library is :
Width x Height x 8 (bits) x 3(channels) / 8 x 1.65
NextGEN Gallery shows you the current memory usage of WordPress and all loaded plugins inside the server settings :

Now have a look at your Memory Limit in the server settings and you can calculate the maximum resolution for your images, which you can manipulate (create thumbnails) with the GD library. It’s possible to change the memory limit, but there exist various way’s and not all of them are allowed at your web server. At the best contact your web hoster, if you want to increase this limit. A good and useful value for images is a limit of 64 MB.






“After I answered this question now 1000 times , I hope this post will clarify this point.”
And this is just one small point! You might want to think about making a deal with someone (moi?). You will explain how it all works to this person and he (or she) in return will explain in X number of posts and in incredible detail to the world how it ALL works.
Ehh ? Didn’t get the point.. What deal ? Are you willing to help ?
Thank you for the good explanation. I had the same problem and I contacted my provider an they change the limit from 32 MB to 64 MB.
Now everything works perfectly.
Thanks a lot :-)))
Thanks, good to know that is article is not useless….
The comment is not useless, in fact it’s pretty helpful.
However, it’s the snarky tone of the first sentence (”I’ve told you children a thousand times already…”) that sets my teeth on edge.
Look, dude, I searched the forums and read several pages of posts before deciding the answer wasn’t here or easily findable. That’s why I posted the question. I’m not an idiot. And I’m not an inconvenience, but that’s how it comes off.
Last but not least: If a question has been asked “a thousand times”, wouldn’t you think you could save yourself lots of time and aggravation by putting it into an FAQ?
Again, thank you for the explanation, if not the snark.
(Error : Create Image failed. Check memory limit)
My Memory Usage is 11.79MB and my PHP Memory Limit is 65MB. So what is the Problem?
PHP Memory is not the same as GD Memory?
Server- Einstellungen
Betriebssystem : Linux
Server : Apache
Speicherverbrauch : 11.79 MByte
MySQL Version : 4.1.22-max-log
SQL Modus : Nicht gesetzt
PHP Version : 4.4.8
PHP Safe Mode : Aus
PHP Allow URL fopen : An
PHP Memory Limit : 65M
PHP Max Upload Size : 200M
PHP Max Post Size : 200M
PHP Max Script Execute Time : 30s
PHP Exif Modul : Ja ( V1.4 )
PHP IPTC Modul : Ja
PHP XML Modul : Ja
GD Unterstützung
GD Version : bundled (2.0.28 compatible)
FreeType Support : Ja
FreeType Linkage : with freetype
T1Lib Support : Ja
GIF Read Support : Ja
GIF Create Support : Ja
JPG Support : Ja
PNG Support : Ja
WBMP Support : Ja
XBM Support : Ja
JIS-mapped Japanese Font Support : Nein
@Dave
Yes, you are right. I’m a little bit irritably. With Google and a bit of reading in the forums this is already answered many times. At the end I wrote this article to help and not to blame somebody…
Hey Alex
Thank you for article, it cleared a lot up for me. I haven’t had the problem on my own site, but I have recently installed WordPress and NEXGen on my girlfriends homepage and she get’s the error message constantly.
So I’m glad you made this post, even if you had been asked 1000 times. I didn’t see it as an irretable response.
Have a great day (and thank you so much for your great efforts on NEXGen)
Henrik
@Steve
Did you read this article? If you didn’t, read this article, it explains a lot about the error!
Hi Alex.. I have a question about this topic;
I have two blogs on different domains. Hosted by the same host. My server settings are exactly the same on both sites.
I have updated nextgen gallery on one of my sites recently, and now I get the “exceed Memory limit” error more frequently. Before it worked fine. i’m not uploading larger/resolution images than usually. Can it be that from the latest nextgen versions it takes more use of the memory than before?
My other site where I still have nextgen version “V0.90 - 18.03.2008″ still works fine. I tested it with exactly the same images from my other site.
Any idea how this can be?
Hi,
Just a note to add to these comments… nextgen reports my site as having:
PHP Memory Limit : 128M
and I am struggling to get anything to work (my camera is 4 megapixel - sometimes resizing and thumbnails will work and other times it wont).
It appears there must be a problem elsewhere… my error logs show Out of memory (allocated 32505856) (tried to allocate 9152 bytes).
I have no control over my webhost but it seems like even though I can use ini_set, php5.ini and the newly built in wordpress config setting (yes, it just uses ini_set), the PHP memory limit must be capped at around 32M by my hosts admins and they will not change it.
I am not pointing a finger of blame to anyone, but my galleries used to work… the camera is the same make/model/settings, the webhost is still the same (they don’t upgrade software - only complete servers)… the only thing that has changed is the WordPress version and nextgen version.
It is a shame that people are having these problems as nextgen is a superb way to add photos and galleries to a blog, but you can’t please everyone all the time.
For people who are running nextgen successfully - good on you, continue to support it… but for my blog, and my partners blog (she has 108 pictures in 14 galleries - luckily its not more)… it looks like we have got to convert to the new and boring WordPress default.
Thank you for the great plugin. I have the next problem though: each time I post a gallery with nextgen, my memory limit decreases. N10×1024 pixel images were no problem in the past, but now 3×640 pixels images will not work anymore.cannot generate thumbnails due to the memory error. using wordpress 2.5.1.
* Operating System : Linux
* Server : Apache (UNIX)
* Memory usage : 13.38 MByte
* MYSQL Version : 5.0.24alyceu
* SQL Mode : Not set
* PHP Version : 4.4.7
* PHP Safe Mode : On
* PHP Allow URL fopen : On
* PHP Memory Limit : 16M
* PHP Max Upload Size : 50M
* PHP Max Post Size : 50M
* PHP Max Script Execute Time : 30s
* PHP Exif support : No
* PHP IPTC support : Yes
* PHP XML support : Yes
GD support
* GD Version : 2.0 or higher
* FreeType Support : Yes
* FreeType Linkage : with freetype
* T1Lib Support : No
* GIF Read Support : Yes
* GIF Create Support : Yes
* JPG Support : Yes
* PNG Support : Yes
* WBMP Support : Yes
* XBM Support : No
* JIS-mapped Japanese Font Support : No
Ok, if I make the thumbnails manually it works! So I got confused by the message telling me I had a memory problem.
I also found out that some images were 150dpi instead of 72. This is also causing the warning.
Would it be possible to make an option where the resize will be done with javascript on the client´s side when you pick an image to upload?
In that case we wouldn´t have the problem with the memory limit…
Why bothering with partial transformation … when we can ask our provider for more MEM … This doesnt have to fit on a sattellite .. eh ?
Maybe this is of some help: NextGen Gallery: upload_max_filesize.