Help: Memory Leaks

Ned Harding nharding at EXTENDTHEREACH.COM
Wed Sep 14 11:41:08 EDT 2005


Thank you Frank for looking in to that...  I guess the short answer is that
I probably wasn't doing anything wrong.  When we have some spare cycles Jani
or I will chase some of the other leaks down...

On a related note:

I know most people on this list are on Linux, but for finding memory leaks
on Windows I have found a really handy free tool that is super easy to use:

http://www.codeproject.com/tools/visualleakdetector.asp

Ned.

-----Original Message-----
From: Frank Warmerdam [mailto:fwarmerdam at gmail.com] 
Sent: Tuesday, September 13, 2005 5:23 PM
To: Ned Harding
Cc: MAPSERVER-DEV at lists.umn.edu
Subject: Re: [UMN_MAPSERVER-DEV] Help: Memory Leaks

On 9/13/05, Ned Harding <nharding at extendthereach.com> wrote:
>  
> 
> I'm trying to work with MapServer and getting bunches of memory leaks.  
> I presume I am doing something wrong.
>   
> In particular there are a bunch of leaks I'm getting in msDrawMap: 
>   
>    Call Stack: 
>     f:\vs70builds\3077\vc\crtbld\crt\src\strdup.c (48):
> _strdup 
>     s:\3rdparty\gis\mapserver\mapoutput.c (464):
> msAllocOutputFormat 
>     s:\3rdparty\gis\mapserver\mapoutput.c (735):
> msCloneOutputFormat 
>     s:\3rdparty\gis\mapserver\mapoutput.c (694):
> msApplyOutputFormat 
>     s:\3rdparty\gis\mapserver\maplegend.c (324):
> msDrawLegend 
>     s:\3rdparty\gis\mapserver\maplegend.c (403):
> msEmbedLegend 
>     s:\3rdparty\gis\mapserver\mapdraw.c (534): msDrawMap


Ned,

I created a test case with an embedded image (msautotest/misc/legend.map)
and was able to reproduce your leak.  It seems the legend was
rendered to an imageObj.  The gdImage was "stolen" out of this
and pushed into a pixmap symbol to render but the rest of the
imageObj was not cleaned up. 

I also fixed the "can't get rid of the last errorObj in USE_THREAD
mode" problem.  As well I fixed a couple of GDAL/OGR related leaks
though you might not be seeing those. 

The core rendering sequence of mapserver is pretty much leak 
free, but "esoteric" features like legends, less common data 
providers and unusual use modes such might have issues.  I
encourage you to report them when you run into them. 

Best regards,
-- 
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20050914/4c255334/attachment.html


More information about the mapserver-dev mailing list