[mapguide-internals] Found at least one memory leaks in Mapguide API

Walt Welton-Lair walt.welton-lair at autodesk.com
Mon Jul 6 10:10:48 EDT 2009


I've found at least one refcount leak in the unmanaged code.  In WebLayout.cpp line 1329 there's:

                widgets->Add(ParseWidget(elt));

The result is that none of the widgets that get created via this call to ParseWidget will be deleted.

The needs to be changed to:

                Ptr<MgWebWidget> widget = ParseWidget(elt);
                widgets->Add(widget);

I'll take care of this shortly.  I'm scanning for similar issues.

SWIG generated code should be fine, BTW.

Walt

-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Jackie Ng
Sent: Monday, July 06, 2009 10:02 AM
To: mapguide-internals at lists.osgeo.org
Subject: Re: [mapguide-internals] Found at least one memory leaks in Mapguide API


SWIG is generating the MgWebLayout wrapper from this header:

http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Web/src/WebApp/WebLayout.h

The implementation is here:

http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Web/src/WebApp/WebLayout.cpp

Something wrong with the refcounting perhaps?

- Jackie


Bruno Scott wrote:
> 
> I'm investigating some memory leaks in Mapguide while i'm doing stress
> testing.
> You can see numbers and graphics there:
> http://n2.nabble.com/Here%27s-some-stress-testing-on-Mapguide-td3182666.html
> I was surprise by the leaks in w3w service and i have found the line that
> leaks:
> 
> $wl = new MgWebLayout($resourceSrvc, $wli);
> or
> MgWebLayout wl = new MgWebLayout(resourceSrvc, wli);
> 
> 
> Two pages use it, getttingstarted and mainframe.
> It leaks both in aspx and php.
> Leak is quite big, 400K/sec with 20 concurent users.
> Disposing the variable as no effect
> 
> I'm not so familiar with SWIG, source code is difficult to read.
> Could someone help me fix this one?
> 
> Bruno
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Found-at-least-one-memory-leaks-in-Mapguide-API-tp3212879p3213187.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.
_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals


More information about the mapguide-internals mailing list