[wp-trac] Re: [WordPress Trac] #4709: Free up memory by using imagedestroy() in wp_create_thumbnail()

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 7 13:57:36 GMT 2007


#4709: Free up memory by using imagedestroy() in wp_create_thumbnail()
--------------------------+-------------------------------------------------
 Reporter:  Viper007Bond  |        Owner:  anonymous  
     Type:  enhancement   |       Status:  new        
 Priority:  normal        |    Milestone:  2.3 (trunk)
Component:  Optimization  |      Version:  2.3        
 Severity:  normal        |   Resolution:             
 Keywords:                |  
--------------------------+-------------------------------------------------
Comment (by Otto42):

 The thumbnail takes up almost no memory. If you want to really free up
 memory, you should do imagedestroy($image) immediately after the call to
 imagecopyresampled. $image is the full sized image which was loaded into
 memory, the resulting $thumbnail is tiny by comparison.

 While all this is likely unnecessary, I agree that it's a good idea for
 the wp_create_thumbnail functions to cleanup after themselves a bit
 better, since it's possible that plugins and/or other code may attempt to
 use these directly. WordPress doesn't need this code itself in most cases,
 but it won't hurt anything to have it there and it might help reduce some
 people's out-of-memory issues.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4709#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list