forum.coppermine-gallery.net

No Support => General discussion (no support!) => Topic started by: Fed on January 30, 2007, 12:56:34 am

Title: PHP memory usage
Post by: Fed on January 30, 2007, 12:56:34 am
Hello folks, this time I'm not talking about anything related to coppermine (no need to edit my coppermine)
I've developed a simple script that I use to upload images and resize them (using GD)
I don't know if it's normal but with some process monitoring utilities I've found out it uses 30-55 MB when dealing with images at 1600x1200 full quality ~1.8 MB (I run this rough test on my windows XP box running XAMPP)
do you think it's normal?
am i doing something wrong?
moreover, would it decrease if I used a lower quality for the produced image? which percentage of quality is acceptable in order not to have any perceivable loss of quality?
Title: Re: PHP memory usage
Post by: Stramm on January 30, 2007, 12:25:55 pm
a pic editing proggy or library can't handle compressed data. Therefore the picture always is in the momory uncompressed. That's the same for Photoshop, Gimp, ImageMagick or GD2. As said, not important is the pictures compressed size but its width, height and color depth. That's for your size ~8-10mb usage just for the image.
Title: Re: PHP memory usage
Post by: Fed on January 30, 2007, 09:26:36 pm
thanks stramm
and how much ram do you think it might use when creating a thumbnail and a mid size image? (GD2)
and what about writing on the image with http://en.php.net/manual/it/function.imagestring.php ?
Title: Re: PHP memory usage
Post by: Nibbler on January 30, 2007, 10:28:13 pm
Try it for yourself and you can see exactly how much it needs.
Title: Re: PHP memory usage
Post by: Fed on January 31, 2007, 10:12:18 am
you're right Nibbler
actually I created this discussion because it seems I can't find any utility that allows me to accurately monitor memory usage on my windows computer
task manager and all the others I've tried don't track the usage of the script but bundle it with apache's overload
Title: Re: PHP memory usage
Post by: Nibbler on January 31, 2007, 02:14:15 pm
http://php.net/memory_get_usage