<p dir="ltr"><br>
On 21 Oct 2015 6:49 PM, "Nyall Dawson" <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> wrote:<br>
><br>
><br>
> On 21 Oct 2015 3:20 PM, "Nyall Dawson" <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> wrote:<br>
> ><br>
> > On 9 October 2015 at 01:45, RĂ©gis Haubourg<br>
> > <<a href="mailto:regis.haubourg@eau-adour-garonne.fr">regis.haubourg@eau-adour-garonne.fr</a>> wrote:<br>
> > > Hi all,<br>
> > > I try to narrow down a production issue here.<br>
> > > In long sessions with lot's of redraws on complex projects, memory seems to<br>
> > > increase regularly.<br>
> > ><br>
> > > In a more simple environnement with no plugins, just sending multiple<br>
> > > redraws using F5 key triggers it.<br>
> > > It grows quite fast on 2.6 up to 4Go sometimes, quite slower in master and<br>
> > > 2.10. Every 5-6 redraws, QGIS adds 1Mo of RAM in 2.6, less often in recent<br>
> > > versions.<br>
> > ><br>
> > > If confirmed, and if nothing else is to be blamed (windows?, QT?) this is a<br>
> > > serious issue for enterprise uses, especially if we want to build<br>
> > > application that run all day long with many canvas redraws.<br>
> > ><br>
> ><br>
> > I've done some more testing, using valgrind and massif. Here's what I've found:<br>
> ><br>
> > - there's a big leak coming from Qt's font database. Fixed in Qt 5.1<br>
> > (<a href="https://bugreports.qt.io/browse/QTBUG-26861">https://bugreports.qt.io/browse/QTBUG-26861</a>). About 50% of the memory<br>
> > leaked is caused by this one. We could possibly work around it by<br>
> > having a singleton so we only ever use one QFontDatabase in QGIS, or<br>
> > just get on with the move to Qt5 and get the proper fix for free. ;)<br>
> > - I also see a lot of memory used by Python objects. Specifically, a<br>
> > lot coming from QgsPythonUtilsImpl::evalString and the PyRun_String<br>
> > call in that function. I don't think these are leaks though (at least,<br>
> > not within QGIS). But that's the second largest memory allocator I see<br>
> > reported by massif<br>
> > - There was a small leak of a GEOS object in labeling... don't think<br>
> > this would cause too much memory usage though. I'll submit a fix after<br>
> > giving it some more testing.<br>
> > - Lastly, the remaining large chunk of allocated memory is used by the<br>
> > images stored during rendering. I'm 90% sure these are all properly<br>
> > cleaned, but I still can't throw the niggling suspicion that just<br>
> > maybe there's some special condition in which these images aren't<br>
> > properly deleted.<br>
> ><br>
> > So yeah... no magic fixes to this one unfortunately. (At least, not<br>
> > until QGIS 3.0!)<br>
><br>
> Actually... Scratch that. Just found some huge leaks in certain circumstances. Fixes in progress.</p>
<p dir="ltr">Try with latest master. It's made a huge difference for me. Exporting my most complex atlas (300 pages, with shapeburst, layer effects, some pretty hefty dynamic labeling):</p>
<p dir="ltr">Initially memory usage is about 320mb.<br>
2.8: memory usage grows to 1.5 gb<br>
2.10: memory usage to about 2 gb<br>
Master: memory usage grows to 480 mb</p>
<p dir="ltr">Win! I suspect Qt5 will make another big difference too.</p>
<p dir="ltr">Nyall</p>
<p dir="ltr">><br>
> Nyall<br>
><br>
><br>
><br>
> ><br>
> > Nyall<br>
</p>