Why GD doesn't release memory upon imagedestroy()?
问题 I need a PHP CLI script to do various image transformations via GD functions. The images are quite big so I need to squeeze as much memory as possible. However, imagedestroy() seems not to release memory when asked. Consider following demo script 'test.php': #!/usr/bin/php5 <?php $memory = [0=> memoryCheck()]; $res1 = imagecreatetruecolor(8192, 4096); memoryReport('Res1 created'); $res2 = imagecreatetruecolor(8192, 4096); memoryReport('Res2 created'); imagedestroy($res1); memoryReport('Res1