Perl mapscript memory leak?

Daniel Morissette dmorissette at MAPGEARS.COM
Wed Jun 28 11:22:53 EDT 2006

FYI I fixed a leak of shapefile handles that affected ka-Map 
installations and could likely be the source of (some of) your leaks. 
Perhaps try again after making sure you have that fix, it's in both 4.9 
and 4.8.x:


Stephen Woodbridge wrote:
> Hi Steve et al,
> I ported the ka-map precache2.php to perl and it seems to have a memory 
> leak. I'm not sure what is leaking but when I running it, like on the 
> 1000000, and watch top, you can see the memory grow and it eventually 
> fails to on $oMap->draw() command. If I rerun the script and skip the 
> already generated tiles, it gets to that same image and works fine then 
> memory grows as it writes more tiles and dies again.
> Processing scale=1000000, cellSize=0.00317478168804209
>   geo dimensions: -160, 15 : -60, 75
>   pix dimensions: -50397.16608, 4724.73432 : -18898.93728, 23623.6716
>   meta dimensions: -51200, -24320 : -17920, -3840
>   meta tiles: 26 x 16 = 416 meta tiles and 10400 tiles
>     Group: __base__
> Can't call method "save" on an undefined value at ./ line 352.
> There is a chance that this is related, but I'm guessing it is 
> more likely a problem with perl/mapscript. Neither nor mapscript 
> have explicit image destroy methods. These are all in narrow scoped 
> loops and I have try to explicitly undef the variables but that doesn't 
> help.
> I'm running a version of mapserver cvs from a few weeks ago. I can 
> upgrade to the current cvs, but was reluctant to in the middle of SteveL 
> doing GEOS commits yesterday.
> This would be a good stress test of the API and I'm willing to provide 
> the script.
> Any thoughts?
> -Steve

Daniel Morissette

More information about the mapserver-dev mailing list