xpra icon
Bug tracker and wiki

Opened 5 months ago

Closed 4 months ago

#1836 closed task (fixed)

reduce memory footprint

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

Description

  • don't load modules until we actually need them
  • if we probe then discard them (ie: codec probing), make sure we unload the library

Change History (3)

comment:1 Changed 5 months ago by Antoine Martin

Status: newassigned

Done:

  • r19271 auth modules (+r19272)
  • r19273 zlib in websockets (still loaded for network caps...)
  • r19275 delay loading XpraProxy until actually needed
  • r19276 split crypto from digest bits (still loaded from network caps..)
  • #1850 unused video encoder contexts were lingering
  • #1838 base class refactoring / skip loading unused functionality
  • r19285 launcher was doing crypto_backend_init unconditionally

Still TODO - probably using imp.find_module to do a lazy module presence check:

  • delay or remove extra bits (ie: version info) from the network caps so we don't need to load crypto or zlib, lzo, lz4, yaml, bencode, etc
  • build a map of codecs-to-encoding(s), so we know what we can handle without actually loading them? won't work for video codecs as those have too many build time + runtime options (ie: checks for hardware availability) - and those are the heavy ones unfortunately..
Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:2 Changed 5 months ago by Antoine Martin

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

According to https://stackoverflow.com/a/29579072/428751: CPython never unloads its C extension modules.

As for the packet encoders and packet compressors, it would be really tedious to use lazy loading here and those libraries are very small anyway.

So this will do for now.

@maxmylyn: mostly a FYI, you probably won't be able to spot the small decrease in memory usage unless you also take advantage of #1838 to completely turn off some subsystems.

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

Resolution: fixed
Status: newclosed

Noted and closing.

Note: See TracTickets for help on using tickets.