Printing to ipp printer uses multiple GB of ram. pdftoraster and/or filter chain selection at fault?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cups-filters (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
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/
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://
100 /var/lib/
In the system print settings the printer has the device URI "implicitclass:
From watching htop I get the impression that somewhere along the way that changes to "ipp://
I am attaching test pdfs which exhibit the described memory use when used with pdftoraster like this:
/usr/bin/time -v /usr/lib/
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_
## Trying to debug with cupsfilter:
I also tried to reproduce the issue by following the steps on the debian wiki about cupsfilter:
https:/
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/
driverless cat 'ipp://
The former only outputs pdf:
$ /usr/sbin/
pdftopdf
The latter uses gstoraster:
$ /usr/sbin/
pdftopdf
gstoraster
rastertopwg
Running either without the --list-filters option finishes reasonably fast and doesn't use excessive ram.
summary: |
- When printing to ipp printer, multiple GB of ram are used. pdftoraster - and/or filter chain selection at fault? + Printing to ipp printer uses multiple GB of ram. pdftoraster and/or + filter chain selection at fault? |
I'm having the same problem on a Brother HL-L2370DW printer on 21.04. My machine has 32GB of memory but has trouble printing longer documents. After hitting "print", memory usage continues creeps up over a long period of time and consumes a lot of memory. I believe the OOM killer killed pdftoraster at least once on my machine while trying to print.