@manu There has been a recent pull request about this issue :- https://github.com/OpenPrinting/cups-filters/pull/363
I believe this would solve the issue of monotonous increase of ram usage. Please try this and let me know. I also checked the error_log attached by you closely. So your print queue involves these filters:- pdftopdf - gziptoany - pdftoraster - rastertopwg The problem was indeed with pdftoraster. It was using too much ram and time. I think the RAM issue would be sorted out by now and I am now looking into the time issue. For this command :- /usr/bin/time -v /usr/lib/cups/filter/pdftoraster 99 manu sometitle 1 'PageSize=A4 output-format=apple-raster Resolution=600dpi' testdoc/testpdf > pdftorast.out The system time ranged from 5-17 seconds for test12.pdf to test48.pdf as memory_use.txt indicates. But in your error_log I can see that pdftoraster took 2 minutes to process test12.pdf. Also I checked pdftoraster processing using the same command and it took 2 minutes for test12.pdf in my case too. So when you are sending a print queue to your printer, if I talk specifically about test12.pdf, pdftoraster is taking more than 2 minutes to process in your case. And this time-taken increases with the number of pages your document has. Please try to test the above PR and see if it solves the ram usage issue and meanwhile I am looking into why pdftoraster is taking more than its runtime if that is the case. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to cups-filters in Ubuntu. https://bugs.launchpad.net/bugs/1920190 Title: Printing to ipp printer uses multiple GB of ram. pdftoraster and/or filter chain selection at fault? Status in cups-filters package in Ubuntu: Confirmed Bug description: I have an ipp/AirPrint capable printer (Brother MFC L2710DW) which automatically got added by Ubuntu (I'm on XUbuntu). Printing larger documents will easily use multiple gigabytes of ram. If the document is large enough this makes printing impossible or _very_ slow, as the process either gets killed or starts swapping. By watching htop and /proc/$pid/exe I was able to determine that the filter at fault seems to be /usr/lib/cups/filter/pdftoraster. Indeed, manually calling pdftoraster with similar arguments as passed by cups (taken from /proc/$pid/cmdline) I can observe the same memory use behaviour. Memory used seems to be linear in the number of pages and will reach around 7GB for a 48 page test-document. I am not sure if the resolution should be to fix the memory usage of pdftoraster or to make cups select a different filter chain. I describe below how I first tried to debug the issue with the help of the Debian wiki on cupsfilter and wasn't able to get the same behaviour because cupsfilter would select a different filter chain (involving gstoraster instead of pdftoraster). For my current situation it would also be nice to know if there's some way for me to work around the issue until it's fixed by printing via the filter chain selected by cupsfilter. Should adding the printer manually via the xfce interface or the cups webinterface work? Please let me know if you need more information. ## Further info: $ lsb_release -rd Description: Ubuntu 20.04.2 LTS Release: 20.04 $ apt-cache policy cups-filters cups-filters: Installed: 1.27.4-1 Candidate: 1.27.4-1 Version table: *** 1.27.4-1 500 500 http://at.archive.ubuntu.com/ubuntu focal/main amd64 Packages 100 /var/lib/dpkg/status In the system print settings the printer has the device URI "implicitclass://Brother_MFC_L2710DW_series/". From watching htop I get the impression that somewhere along the way that changes to "ipp://Brother%20MFC-L2710DW%20series._ipp._tcp.local/" (that's the argv[0] of the offending process, the binary for which is /usr/lib/cups/filter/pdftoraster). I am attaching test pdfs which exhibit the described memory use when used with pdftoraster like this: /usr/bin/time -v /usr/lib/cups/filter/pdftoraster 99 manu sometitle 1 'PageSize=A4 output-format=apple-raster Resolution=600dpi' testdoc/test48.pdf > pdftorast.out The memory use and timings I get are in memory_use.txt. Information about the processes involved and their arguments when printing is in watching_printing.txt. ## Trying to debug with cupsfilter: I also tried to reproduce the issue by following the steps on the debian wiki about cupsfilter: https://wiki.debian.org/CUPSFilter Interestingly, I could not get cupsfilter to select the same filter chain. I am not sure which ppd I should be using, though. I tried with /etc/cups/ppd/Brother_MFC_L2710DW_series.ppd and with a ppd generated by driverless cat 'ipp://Brother%20MFC-L2710DW%20series._ipp._tcp.local/' The former only outputs pdf: $ /usr/sbin/cupsfilter -p Brother_MFC_L2710DW_series.ppd -m printer/foo -o number-up=2 testdoc/test96.pdf -e --list-filters pdftopdf The latter uses gstoraster: $ /usr/sbin/cupsfilter -p driverless.ppd -m printer/foo -o number-up=2 testdoc/test96.pdf -e --list-filters pdftopdf gstoraster rastertopwg Running either without the --list-filters option finishes reasonably fast and doesn't use excessive ram. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/1920190/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp