The memory required to load an image using imagecreatefromjpeg() is a function of the image's dimensions and the images's bit depth, multipled by an overhead. It can calculated from this formula: Num bytes = Width * Height * Bytes per pixel * Overhead fudge factor Where Bytes per pixel = Bit depth/8, or Bits per channel * Num channels / 8. This script calculates the Overhead fudge factor by loading images of various sizes. Limit: 50M Usage before: 385.74 KB Loading image image1.jpg, size 1648 * 1236, bpp 8... done Memory usage: 386.33 KB Difference: 600 bytes Difference / (Width * Height * Bytes per pixel): 9.8187073868099E-5 Destroyed. Memory usage: 386.7 KB Loading image image2.jpg, size 824 * 618, bpp 8... done Memory usage: 386.7 KB Difference: 0 bytes Difference / (Width * Height * Bytes per pixel): 0 Destroyed. Memory usage: 386.7 KB Loading image image3.jpg, size 3296 * 2472, bpp 8... done Memory usage: 386.7 KB Difference: 0 bytes Difference / (Width * Height * Bytes per pixel): 0 Destroyed. Memory usage: 386.7 KB Mean fudge factor: 3.27290246227E-5