(gnu) screen defscrollback memory hog
Submitted by litwol on Sun, 11/20/2011 - 19:22
Screen configuration variable defscrollback controls the length of scrollback for all newly created windows ("def" for default i imagine).
Take care not to set this value too large as screen seems to maintain scrollback entirely in ram. I found out the hard way after setting defscrollback 1000000 which made screen consume over 300MB ram out of maximum 512MB on my VPS.
If you really need to have so much backscroll, consider using screen's logging to file functionality.
excerpt from "man screen":
COMMAND-LINE OPTIONS
-L tells screen to turn on automatic output logging for the windows.
DEFAULT KEY BINDINGS
C-a H (log) Begins/ends logging of the current window to the file "screenlog.n".
2 reponses to "(gnu) screen defscrollback memory hog"
1. Decreasing the memory usage of GNU screen
Nice info, thanks. I had a doubt, say once I have given huge scrollback to each window, and my screen is taking up lot of memory, is there a way to reduce the RAM usage, I tried setting up scrollback buffer of each window to 0, but that did not decrease the memory usage at all, Is there a way to do that ?
2. Make sure you change
Make sure you change "scrollback" value for every open screen window, otherwise all open windows will still use the previous large scrollback number.
you can either make every window active at a time and manually set low scrollback number using "CTRL-a :scrollback ###", or set scrollback number in .screenrc and then "CTRL-a :source .screenrc" (i did not check that last method, let me know if it works).
Post new comment