<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Template manager slow to load template previews"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=101467#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Template manager slow to load template previews"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=101467">bug 101467</a>
from <span class="vcard"><a class="email" href="mailto:iplaw67@tuta.io" title="Alex Thurgood <iplaw67@tuta.io>"> <span class="fn">Alex Thurgood</span></a>
</span></b>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>