We want to create screenshots of websites for our software, and we are doing this by using CutyCapt with Xvfb.

Unfortunatly every time CutyCapt takes a screenshot, the memory of Xvfb increases .. until the memory of the boy explodes. This is not bound to CutyCapt, it seems that the Xvfb doesn't clean some memory when the application quits.

Are there any solutions (except restarting Xvfb (which we do now via cron as a hotfix)).

I start Xvfb with Xvfb :1 -screen 0 1280x1024x24 (in a script of course ;) )

2 Answers 2


Adding -noreset to Xvfb arguments makes the memory leak go away. See my writeup on the issue here.

  • did not seem to work for me, Im using xvfb-run inside of a docker container running node. Aug 7, 2020 at 1:11

There are known memory leaks in Xvfb; see for example Red Hat bug #498357 (and #201536 before it).

Restarting Xvfb after a time interval, or when its memory size reaches a certain threshold ([ $(ps -o vzs= $pid) -ge $threshold ]), or after a certain number of screenshots, seem reasonable workarounds until this bug is located and fixed.

  • Well, no real solution since I already do restarts. But because it is a known bug you give me the connecting point to, and there is no other solution, I accept it. Thanks.
    – Dag
    Nov 30, 2011 at 22:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .