[Libreoffice-bugs] [Bug 101467] Template manager slow to load template previews

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Aug 8 13:56:23 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=101467

--- Comment #4 from Alex Thurgood <iplaw67 at tuta.io> ---
Well profiling with Instruments.app under Mac OSX and my master build shows
that LO leaks memory fairly importantly in this function block of code in 


templatelocalview.cxx :

void TemplateLocalView::insertItems(const std::vector<TemplateItemProperties>
&rTemplates, bool isRegionSelected, bool bShowCategoryInTooltip)
{
    mItemList.clear();

    std::vector<ThumbnailViewItem*> aItems(rTemplates.size());
    for (size_t i = 0, n = rTemplates.size(); i < n; ++i )
    {
        const TemplateItemProperties *pCur = &rTemplates[i];

        TemplateViewItem *pChild;
        if(isRegionSelected)
            pChild = new TemplateViewItem(*this, pCur->nId);
        else
            pChild = new TemplateViewItem(*this, i+1);

        pChild->mnDocId = pCur->nDocId;
        pChild->mnRegionId = pCur->nRegionId;
        pChild->maTitle = pCur->aName;
        pChild->setPath(pCur->aPath);

        if(!bShowCategoryInTooltip)
            pChild->setHelpText(pCur->aName);
        else
        {

Each invocation of 

else
            pChild = new TemplateViewItem(*this, i+1);


causes 400 bytes of memory to leak. Multiply that by the number of templates
you have and memory consumption quickly skyrockets.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170808/0da9932b/attachment.html>


More information about the Libreoffice-bugs mailing list