in reply to Re^4: endless loop problems
in thread endless loop problems
This might be getting a little on the OT side but how much memory is used up at a time in this situation?
length($gal) + length($image) + size of list of urls + overhead
It could be changed to
max( length($gal), length($image) ) + size of list of urls + overhead
but it's probably not worth it.
Does the memory clear after each image?
Yes. Variables $gal and $img get freed (to Perl, not to the OS) at the end of their respective enclosing blocks, since they are lexically scoped (my) variables. I could modify the code (by adding a set of curlies) to free $gal sooner, but it's not worth it.
Only one gallery is memory at a time.
Only one image is memory at a time.
I'd have to think [...] it'd be faster to process the image sizes if they were locally stored.
No. You'd have to extra steps of storing them locally and reading them back in to memory (if only a bit at a time). That's a lot of disk IO you didn't used to have.
|
|---|