Mostly done in r19885 (+r19886).
ie:
$ xpra attach --mmap=no --notifications=no --file-transfer=no --open-files=no \ --open-url=no --printing=no --clipboard=no --system-tray=no --cursors=no \ --bell=no --webcam=no --remote-logging=no --speaker=no --microphone=no \ --av-sync=no --tray=no --windows=no --dbus-proxy=no UIXpraClient<class 'xpra.client.ui_client_base.ClientBaseClass'>: \ (<class 'xpra.client.client_base.XpraClientBase'>, <class 'xpra.client.mixins.display.DisplayClient'>, \ <class 'xpra.client.mixins.network_state.NetworkState'>)
Without turning off features:
$ xpra attach UIXpraClient<class 'xpra.client.ui_client_base.ClientBaseClass'>: (\ <class 'xpra.client.client_base.XpraClientBase'>, <class 'xpra.client.mixins.display.DisplayClient'>, \ <class 'xpra.client.mixins.window_manager.WindowClient'>, <class 'xpra.client.mixins.webcam.WebcamForwarder'>, \ <class 'xpra.client.mixins.audio.AudioClient'>, <class 'xpra.client.mixins.clipboard.ClipboardClient'>, \ <class 'xpra.client.mixins.notifications.NotificationClient'>, <class 'xpra.client.mixins.rpc.RPCClient'>, \ <class 'xpra.client.mixins.mmap.MmapClient'>, <class 'xpra.client.mixins.remote_logging.RemoteLogging'>, \ <class 'xpra.client.mixins.network_state.NetworkState'>, <class 'xpra.client.mixins.encodings.Encodings'>, \ <class 'xpra.client.mixins.tray.TrayClient'>)
TODO / things that could be improved:
tray
and mmap_enabled
attributes are always defined so all mixins can access them (easier - not sure it's worth worrying about)
Updates:
With these changes applied and turning off all the features (including window forwarding..), the client memory usage goes from ~220MB (~280MB without mmap) to just 64MB.
$ ps -eo size,pid,user,command --sort -size | grep xpra | \ awk '{ hr=$1/1024 ; printf("%13.2f MB ",hr) } { \ for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | \ cut -d "" -f2 | \ cut -d "-" -f1 64.65 MB /bin/python /usr/bin/xpra attach
Still TODO:
This one uses 400MB!
$ xpra attach --mmap=no --notifications=no --file-transfer=no --open-files=no \ --open-url=no --printing=no --clipboard=no --system-tray=no --cursors=no \ --bell=no --webcam=no --remote-logging=no --speaker=no --microphone=no \ --av-sync=no --tray=no --windows=yes --dbus-proxy=no
clipboard token fix in r19895, high memory usage moved to #1913.
@maxmylyn: FYI, feel free to close.
When disabling features (ie: --clipboard=no
), the code won't be loaded at all now and the corresponding options are removed from the systray menu.
If a module is not installed (ie: build with ./setup.py build --without-clipboard
), then attempts to enable functionality that relies on this module will trigger a warning.
Noted, will pass a note along.
Closing.
With the changes from #1913, the client memory usage goes down from ~220MB to ~130MB when turning off all non-essential options.
See also #2344
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1861