Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip client base classes #1861

Closed
totaam opened this issue May 29, 2018 · 5 comments
Closed

skip client base classes #1861

totaam opened this issue May 29, 2018 · 5 comments

Comments

@totaam
Copy link
Collaborator

totaam commented May 29, 2018

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

@totaam
Copy link
Collaborator Author

totaam commented Jul 8, 2018

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

@totaam
Copy link
Collaborator Author

totaam commented Jul 9, 2018

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

@totaam
Copy link
Collaborator Author

totaam commented Jul 9, 2018

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.

@totaam totaam closed this as completed Jul 9, 2018
@totaam
Copy link
Collaborator Author

totaam commented Aug 1, 2018

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

@totaam
Copy link
Collaborator Author

totaam commented Jun 29, 2019

See also #2344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant