On Mon, Mar 25, 2013 at 03:53:06AM +0100, Sebastian Ramacher wrote:
> On 2013-03-24 07:28:03, Marwan Tanager wrote:
> > While browsing the bug tracker for related issues, I found the one at 
> > http://bugs.pwmt.org/issue95 which points out the version as not 
> > suffering from this problem. I built it and experimented. The result was 
> > that 
> > the total amount of memory consumed by scrolling through the length of the 
> > 1300-pages document was comparable to the one with this patch. So, there 
> > must 
> > be something messy happening with cairo_surface_destroy when it's get 
> > called 
> > from the timeout function while scrolling. Maybe it's non-reentrant and 
> > some 
> > mess happens when it's called concurrently from both the timeout function 
> > and 
> > the render thread.  But if that's the case, then why doesn't it free the 
> > memory 
> > after the first time, even when there is no scrolling? Also, I tried to 
> > experiment with mutexes around the cairo_surface_destroy calls on the 
> > render 
> > thread and zathura_page_widget_update_surface but nothing surprising has 
> > happened.
> I played a bit with the code tonight. What puzzles me is that it works
> for the first time but not for any subsequent purge operations. As far
> as I can tell, the ref counters of the surface are 1 and thus
> cairo_surface_destroy should free the image. cairo_surface_destroy is
> definitely called, but I really don't know why nothing happens [1].

I've done exactly the same test and made sure the ref count is always 1 before 
the call. That's exactly what drove me nuts!

zathura mailing list

Reply via email to