Memory leak (reloading the same file increases memory consumption)
Submitted by Phillip Berndt
Assigned to poppler-bugs
Created attachment 107455 Test program
The attached test program loads a PDF file, draws it, unloads the file, and then starts over again. To compile it, use
cc test.c -o test $(pkg-config --libs --cflags gtk+-3.0 glib-2.0 cairo gio-2.0 poppler-glib)
and then start it with a PDF file as its first argument, preferably a large one, like a paper or a book.
I'd expect some, limited growth in memory consumption, due to things like caching, but instead memory usage appears to grow linearly. With a 147kB PDF, I'm at 1.5GB memory consumption after some minutes. I tested this with Poppler 0.24.5 and 0.26.5, but not with the latest git version, on a machine running Ubuntu Trusty.
If I run the same program with a gdk-pixbuf and images instead of poppler, memory consumption does not increase, so I am quite positive that this is indeed a poppler bug and not one in gtk/glib. I did not make any attempts to find the source within poppler though, so I can't tell if this really is a problem in the glib frontend or if the problem lies in the backend.
Attachment 107455, "Test program":