Here is a streamlined version of the massif file that Kornel sent
privately to me. As far as I can see below, it only accounts for 50 to
100MB.
Comments in the output below (I replaced ugle basic_string<> expressions
with docstring).
JMarc
The memory is actually increasing and the largest snapshot is number 48,
which accounts if I am right for 100MB (50 useful and 50 junk).
Number of snapshots: 50
Detailed snapshots: [1, 3, 16, 27, 34, 48 (peak)]
--------------------------------------------------------------------------------
n time(i) total(B) useful-heap(B) extra-heap(B)
stacks(B)
--------------------------------------------------------------------------------
[...snip]
48 235,811,651,798 50,965,016 48,119,273 2,845,743
0
94.42% (48,119,273B) (heap allocation functions) malloc/new/new[],
--alloc-fns, etc.
The first chunk below (16MB of useful heap) is related to a work area
that is created when doing the advanced searched thing. I suspect that
these WAs are created and never deleted. This is something that should
be investigated.
->31.49% (16,051,040B) 0x572D724: QImageData::create(QSize const&,
QImage::Format, int) (qimage.cpp:209)
| ->30.93% (15,763,936B) 0x572E889: QImage::QImage(int, int,
QImage::Format) (qimage.cpp:811)
| | ->27.51% (14,022,112B) 0xE00A02:
lyx::frontend::GuiWorkArea::Private::resetScreen()
(GuiWorkArea_Private.h:128)
| | | ->23.76% (12,109,440B) 0xDF813D:
lyx::frontend::GuiWorkArea::init() (GuiWorkArea.cpp:283)
| | | | ->23.76% (12,109,440B) 0xDF8025:
lyx::frontend::GuiWorkArea::GuiWorkArea(lyx::Buffer&,
lyx::frontend::GuiView&) (GuiWorkArea.cpp:264)
| | | | | ->23.76% (12,109,440B) 0xDFD823:
lyx::frontend::TabWorkArea::addWorkArea(lyx::Buffer&,
lyx::frontend::GuiView&) (GuiWorkArea.cpp:1686)
| | | | | ->23.76% (12,109,440B) 0xDD6D71:
lyx::frontend::GuiView::addWorkArea(lyx::Buffer&) (GuiView.cpp:1209)
| | | | | ->23.76% (12,109,440B) 0xDD7BA5:
lyx::frontend::GuiView::setBuffer(lyx::Buffer*) (GuiView.cpp:1396)
| | | | | ->23.76% (12,109,440B) 0xDE7962:
lyx::frontend::GuiView::dispatch(lyx::FuncRequest const&,
lyx::DispatchResult&) (GuiView.cpp:3359)
| | | | | | ->23.76% (12,109,440B) 0xD917A9:
lyx::frontend::GuiApplication::dispatch(lyx::FuncRequest const&,
lyx::DispatchResult&) (GuiApplication.cpp:1838)
| | | | | | ->23.76% (12,109,440B) 0xD8DE80:
lyx::frontend::GuiApplication::dispatch(lyx::FuncRequest const&)
(GuiApplication.cpp:1230)
| | | | | | ->23.76% (12,109,440B) 0xB12CE1:
lyx::dispatch(lyx::FuncRequest const&) (LyX.cpp:1271)
| | | | | | ->23.76% (12,109,440B) 0xE8C966:
lyx::frontend::FindAndReplaceWidget::findAndReplaceScope(lyx::FindAndReplaceOptions&,
bool) (FindAndReplace.cpp:368)
Of the 22% of heap below, 16% (8.37+8.47 => 8MB) are taken by strings
representing the bibliography. This is probably much too high for 200
entries (I doubt that the bib file is larger than 200kb).
The other entries are not interesting (there is a blob with the font
data allocated by Qt but we cannot do much about it).
->22.53% (11,482,496B) 0x690CC5F: docstring::_Rep::_S_create(unsigned
long, unsigned long, std::allocator<wchar_t> const&) (in
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
| ->20.87% (10,638,188B) 0x690DA09:
docstring::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned long)
(in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
| | ->19.79% (10,086,572B) 0x690DAEE: docstring::reserve(unsigned long)
(in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
| | | ->08.37% (4,263,896B) 0x690E0CC: docstring::operator+=(wchar_t)
(in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
| | | | ->07.47% (3,804,924B) 0xD59AB5: lyx::(anonymous
namespace)::readValue(docstring&, lyx::ifdocstream&, std::map<docstring,
docstring, std::less<docstring >, std::allocator<std::pair<docstring
const, docstring > > > const&) (InsetBibtex.cpp:606)
| | | | | ->07.47% (3,804,924B) 0xD5A80B:
lyx::InsetBibtex::parseBibTeXFiles() const (InsetBibtex.cpp:849)
| | | ->07.47% (3,808,912B) 0x690DFFB: docstring::append(docstring
const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
| | | | ->07.29% (3,716,860B) 0xD5A8D0:
lyx::InsetBibtex::parseBibTeXFiles() const (InsetBibtex.cpp:856)
| | | ->02.21% (1,125,948B) 0xB3C0E4:
lyx::Paragraph::appendString(docstring const&, lyx::Font const&,
lyx::Change const&) (Paragraph.cpp:1744)