Nominate our 2022 Qt Champions!

How use less RAM for embedded qt application on linux ARM?

  • When I start my ARM board, I see Linux and some init programs use around 11MB memory.
    If I then start my (quite large) Qt applictaton (with GUI, network, video,...) , the used RAM rises to 95MB.

    After a while this increases even further to around 120MB, and the device only has 122MB available.
    This is obviously not good, and I want to lower the memory usage.

    How can I use less RAM for embedded qt applications on linux ARM? Or are these large memory requirements normal for Qt?

    PS: I tried using a swap file and then memory + swap usage is relatively steady, so I assume it's not a memory leak.
    (117MB used + 15MB swap)

  • Moderators

    i guess since you are using some Qt modules your best chance is to recompile Qt and disable certain features you do not need.
    This mainly decreases the size of the shared libraries and thus also the memory consumption.

  • Thanks raven-worx.

    The used qt shared libraries have the following sizes:
    Core = 2.9MB
    GUI = 8.7MB
    Network = 907kB
    Phonon = 277kB

    If I use all these shared libraries I only get to ~12.8MB. This is very acceptable, and reducing some features will bring this down a little, perhaps to 10MB combined, but not tens of MB. Or am I misunderstanding?

  • Hi! These libraries themselves pull in other libraries from your system.

  • Moderators

    not only file size will decrease but also the memory allocation by objects.
    But of course you also need to inspect your source code for memory efficiency.
    Using pointers and references as much as possible, object reusage, etc

Log in to reply