Xpra: Ticket #1861: skip client base classes

Same as #1838 but for the client. See also #1796.

Sun, 08 Jul 2018 16:03:49 GMT - Antoine Martin: status changed

Mostly done in r19885 (+r19886).


$ 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:

Mon, 09 Jul 2018 09:21:03 GMT - Antoine Martin:


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

Mon, 09 Jul 2018 14:45:29 GMT - Antoine Martin: owner, status changed

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.

Mon, 09 Jul 2018 16:26:52 GMT - J. Max Mena: status changed; resolution set

Noted, will pass a note along.


Wed, 01 Aug 2018 16:36:47 GMT - Antoine Martin:

With the changes from #1913, the client memory usage goes down from ~220MB to ~130MB when turning off all non-essential options.

Sat, 29 Jun 2019 15:29:14 GMT - Antoine Martin:

See also #2344

Sat, 23 Jan 2021 05:35:43 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1861