about generated temp files
Posted: 2009-11-04T21:54:54-07:00
Hi, magick:
I used imageMagick to build a web server which allowd users to upload images. But recently, I found a problem that seems ImageMagick
does not remove the temporary file as soon as it is no longer needed. Assume that the pid of web server is 3333, when I use the cmd "ls -l /proc/3333/fd",
I see lots of tmp file handler which are not released. such as bellow:
lrwx------ 1 root root 64 Nov 5 10:53 100 -> /data/tmp/magick-XXXFVw0Z (deleted)
if I shutdown the webserver, these handler will be released.
In addition, at the first day of web server lanched, this will not happen, the generated tmp file will be deleted as soon as possible. But after few days, this phenomena will happen
My question is: Dose anyone know how this happen? Dose ImageMagick use a lazy cleanup policy, so it will not cleanup the tmp files until the process exit? My application should work for long of times without restart, so is there any method or APIs let imageMagick clean the tmp file as soon as possilble?
Thanks very much!
I used imageMagick to build a web server which allowd users to upload images. But recently, I found a problem that seems ImageMagick
does not remove the temporary file as soon as it is no longer needed. Assume that the pid of web server is 3333, when I use the cmd "ls -l /proc/3333/fd",
I see lots of tmp file handler which are not released. such as bellow:
lrwx------ 1 root root 64 Nov 5 10:53 100 -> /data/tmp/magick-XXXFVw0Z (deleted)
if I shutdown the webserver, these handler will be released.
In addition, at the first day of web server lanched, this will not happen, the generated tmp file will be deleted as soon as possible. But after few days, this phenomena will happen
My question is: Dose anyone know how this happen? Dose ImageMagick use a lazy cleanup policy, so it will not cleanup the tmp files until the process exit? My application should work for long of times without restart, so is there any method or APIs let imageMagick clean the tmp file as soon as possilble?
Thanks very much!