PHP/Mapscript still has a memory leak

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Fri Aug 11 10:23:07 EDT 2006


Daniel,

I thought of running valgrind, but mapscript was built as an apache DSO 
and will not run under the php-cli. I'm not sure if it is possible to 
run private instance of apache2 under valgrind to do this, or how one 
would do that. Got any ideas on that?

php4 -v
PHP 4.3.10-16 (cli) (built: Aug 26 2005 06:59:49)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

php4 ./precache3.php m=smap-01 s=50000000
<pre>

Fatal error: This build of mapscript can't be load as a 'cli' module for 
stability reason, but only with php as an apache DSO.

-Steve

Daniel Morissette wrote:
> There is always the possibility of a leak, but as Ned pointed out 
> chances are high that this is just caused by memory fragmentation.
> 
> And even if there is a leak, there is nothing that tells us (yet) that 
> it is in PHP MapScript and not in PHP or in other support libs used by 
> the precache script. If you could run your process under Valgrind that 
> would tell you right away if there is a leak (and where) and then that 
> would help us help you a lot.
> 
> Daniel
> 
> 
> 
> Ned Harding wrote:
>> Just because the memory goes up over time doesn't mean it is necessarily
>> a memory leak of that size.  It could easily be memory fragmentation.  I
>> have been fighting this same issue in one of our apps that didn't have
>> any leaks at all but ran out of memory all the same.
>>
>> Ned.
>> -----Original Message-----
>> From: UMN MapServer Developers List [mailto:MAPSERVER-DEV at LISTS.UMN.EDU]
>> On Behalf Of Stephen Woodbridge
>> Sent: Friday, August 11, 2006 7:11 AM
>> To: MAPSERVER-DEV at LISTS.UMN.EDU
>> Subject: [UMN_MAPSERVER-DEV] PHP/Mapscript still has a memory leak
>>
>> Hi Daniel,
>>
>> I just updated to mapserver nightly (Aug 9, 2006) and I'm running the
>> ka-map precache2.php modified to run in apache. The previous fix to
>> solve the leaking file handles improves things greatly, but there is
>> still a memory leak.
>>
>> If I restart apache and fire off the script it uses a modest amount of
>> memory, under 300MB for the process. Since I'm running 25000 scale, it
>> runs a long time, and after 24 hours the process is using over 1GB of
>> memory.
>>
>> I can send my copy of precache2.php if that would help. The mapfile
>> uses:
>>
>>    OUTPUTFORMAT
>>      NAME PNG8
>>      DRIVER "GD/PNG"
>>      EXTENSION "png"
>>      MIMETYPE "image/png"
>>      IMAGEMODE RGBA
>>      TRANSPARENT OFF
>>      FORMATOPTION "QUANTIZE_FORCE=ON"
>>      FORMATOPTION "QUANTIZE_DITHER=OFF"
>>      FORMATOPTION "QUANTIZE_COLORS=256"
>>    END
>>
>> I assume this is reproducible with any mapfile. I'll write a bug on this
>> also.
>>
>> -Steve
>>
> 
> 



More information about the mapserver-dev mailing list