#42545 [Opn]: low SystemPages

From: Date: Wed, 05 Sep 2007 10:03:10 +0000
Subject: #42545 [Opn]: low SystemPages
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-117152@lists.php.net to get a copy of this message
ID: 42545 User updated by: netclone at bigmir dot net -Summary: Resource descriptors leaks Reported By: netclone at bigmir dot net Status: Open Bug Type: GD related Operating System: Windows XP SP2 PHP Version: 5.2.4 New Comment: I can see in performance monitor that PTE is slowly goes down Previous Comments: ------------------------------------------------------------------------ [2007-09-04 16:56:42] netclone at bigmir dot net Description: ------------ System halts, php hangs up - each file-resource handler becomes invalid. I'm using CLI php.exe to process image storage with JPG files with approximately size 2-3Mb each. Script uses database dump file each line of them points to physical file location. This dump has 4000-6000 records. Within cycle it reads one line from dump and call this code, and writes result into log file. It’s outputs ~180 files (~18Kb) per 3-5 sec. Crash becomes at ~ 4h of work. Looks like no more handles aviable. We have same results on 4 PC’s (all PC’s new, just bayed week ago, all systems has same configuration Core2Duo/3GHz/2Gb, firmly HP), running on Windows XP SP2 (all updates installed), installed extensions – php_oci8.dll, php_gd2. Reproduce code: --------------- $url = {image}; $FileDir = {path} //code to read IN file and open log @mkdir($FileDir, 0755, true); if( file_exists($FileDir) ) { $InputImage = @ImageCreateFromJPEG( $url ) $iw = ImageSX($InputImage); $ih = ImageSY($InputImage); $ThumbImage = @imagecreatetruecolor(124, 82)) imagecopyresampled($ThumbImage, $InputImage,0, 0, 0, 0, 124, 82, $iw, $ih); ImageJPEG($ThumbImage, $thumbnail, 80 ); ImageDestroy($ThumbImage); $rows = ceil($iw /256); $cols = ceil($ih /256); for($i = 0; $i < $rows; $i++ ) for( $j = 0; $j < $cols; $j++ ){ if ($OutputImage = @ImageCreateTrueColor( 256,256 ) { ImageCopy( $OutputImage, $InputImage, 0, 0, $x, $y, $cw, $ch ); ImageJPEG( $OutputImage, $OutputFile, 80 ); ImageDestroy($OutputImage); } ImageDestroy($InputImage); } Expected result: ---------------- images in correpsonding folders Actual result: -------------- ~4h all is ok, but at nearly 2500-2700 image it's write in log PHP Warning: imagejpeg(): Unable to open 'xxx.jpg' for writing: Invalid argument in script.php on line xx PHP Warning: fwrite(): supplied argument is not a valid stream resource PHP Warning: fclose(): supplied argument is not a valid stream resource System hangs on, you can't open or run anything and need to reboot. During this time created ~720 000 images ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42545&edit=1

« previous php.bugs (#117152) next »