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

Bruno Scott bscott at geomapgis.com
Mon Jul 6 11:53:16 EDT 2009


Hi all, and thanks for your help

i've made a minimum dotnet program to test MgWebLayout

     InitializeWebTier();
     MgUserInformation cred = new
MgUserInformation("Administrator","admin");
     MgSiteConnection site = new MgSiteConnection();
     site.Open(cred);
     MgResourceService resourceSrvc =
site.CreateService(MgServiceType.ResourceService) as MgResourceService;
     MgResourceIdentifier wli = new
MgResourceIdentifier("Library://Samples/Sheboygan/Layouts/SheboyganPhp.WebLayout");
     MgWebLayout wl = new MgWebLayout(resourceSrvc, wli);
     wl.Dispose();

In Mapguide API i've comment most line in the constructor

MgWebLayout::MgWebLayout(MgResourceService* resourceService,
MgResourceIdentifier* webLayoutId)
:  m_scale(-1.),
   m_hyperlinkTarget(MgWebTargetType::TaskPane),
   m_zoomControlVisible(true)
{
    MG_TRY()
/*
    m_commands = new MgWebCommandCollection();
    m_toolBar = new MgWebToolBar();
    m_statusBar = new MgWebUiSizablePane();
    m_taskPane = new MgWebTaskPane();
    m_informationPane = new MgWebInformationPane();
    m_contextMenu = new MgWebContextMenu();
    if(!m_commands || !m_toolBar || !m_statusBar || !m_taskPane ||
!m_informationPane || !m_contextMenu)
        throw new MgOutOfMemoryException(L"MgWebLayout.MgWebLayout",
__LINE__, __WFILE__, NULL, L"", NULL);

    //get the resource service to query the web layout definition
    Ptr<MgByteReader> xmlWebLayout =
resourceService->GetResourceContent(webLayoutId);

    ParseWebLayoutDefinition(xmlWebLayout);
*/

    MG_CATCH_AND_THROW(L"MgWebLayout.MgWebLayout")
}

Then looping on it 10 concurent users every second i still have a 6 meg
Leaks / minutes
And removing this line from the comment
   m_commands = new MgWebCommandCollection();
I have a 10 Meg leak / minute

And i had to manualy call wl.Dispose() utherwize the destructor would not be
called.
I have a very bad time with the DotNEt Garbage collector :)

Bruno


-- 
View this message in context: http://n2.nabble.com/Found-at-least-one-memory-leaks-in-Mapguide-API-tp3212879p3213772.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.


More information about the mapguide-internals mailing list