xpra icon
Bug tracker and wiki

Opened 7 months ago

Closed 5 months ago

Last modified 5 months ago

#1861 closed enhancement (fixed)

skip client base classes

Reported by: Antoine Martin Owned by: J. Max Mena
Priority: major Milestone: 2.4
Component: client Version: 2.3.x
Keywords: Cc:

Description

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

Change History (5)

comment:1 Changed 5 months ago by Antoine Martin

Status: newassigned

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:

  • server sends clipboard tokens despite clipboard being disabled, causing a packet warning
  • tray and mmap_enabled attributes are always defined so all mixins can access them (easier - not sure it's worth worrying about)
  • skip "display" client mixin?
  • test all combinations / add unit test
  • platform testing: macos and win32
Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:2 Changed 5 months ago by Antoine Martin

Updates:

  • r19889: display mixin made optional
  • r19891: win32 platform fixes
  • r19892: macos menu support

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:

  • spurious clipboard token fix
  • memory usage goes up in some cases!?

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

comment:3 Changed 5 months ago by Antoine Martin

Owner: changed from Antoine Martin to J. Max Mena
Status: assignednew

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.

Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:4 Changed 5 months ago by J. Max Mena

Resolution: fixed
Status: newclosed

Noted, will pass a note along.

Closing.

comment:5 Changed 5 months ago by Antoine Martin

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

Last edited 5 months ago by Antoine Martin (previous) (diff)
Note: See TracTickets for help on using tickets.