Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT app consume RAM
QtWS25 Last Chance

QT app consume RAM

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    callen
    wrote on last edited by
    #1

    I am try to build a simple QT widget application in a buildroot linux,it contains two buttons ,but do nothing.The QT version is 5.6,it's configuration as below:
    0_1500944561252_1599db54-2d33-4c1f-ac8b-de177f1d9360-image.png
    0_1500944583686_44545ca4-60af-42dc-9192-6e247c99564e-image.png
    The QT app's pro add base display config:

    QT += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = simpleQT
    TEMPLATE = app

    what puzzle me is that the app consume about 39760KB RAM(memstat tool detail as below)
    0_1500943740583_bd486e54-2b32-4f07-82cb-346c68e1afd5-image.png

    So,I want to know is:
    1.Why a simple QT app itself consume about 11540KB RAM;
    2.libQt5Gui.so,libQt5Widgets.so and libQt5Core.so also consume 15460KB RAM;
    3.Anyone knows how to reduce QT app itself and shared lib RAM consume?

    1 Reply Last reply
    0
    • sierdzioS Online
      sierdzioS Online
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Your app itself consumes only 20k of RAM. The rest are shared libraries, many of them system libraries - they will be loaded for most programs you run, so you should not worry about it. It's normal.

      Regarding other questions. There are many ways to reduce size:

      • use Qt Lite http://blog.qt.io/blog/2016/08/18/introducing-the-qt-lite-project-qt-for-any-platform-any-thing-any-size/ http://blog.qt.io/blog/2017/05/31/qt-lite-qt-5-9-lts/
      • compile Qt statically, with -reduce-relocations
      • compile your app statically
      • enable compiler flag -Os (optimize for size) - for Qt and for your app

      (Z(:^

      C 1 Reply Last reply
      4
      • sierdzioS sierdzio

        Your app itself consumes only 20k of RAM. The rest are shared libraries, many of them system libraries - they will be loaded for most programs you run, so you should not worry about it. It's normal.

        Regarding other questions. There are many ways to reduce size:

        • use Qt Lite http://blog.qt.io/blog/2016/08/18/introducing-the-qt-lite-project-qt-for-any-platform-any-thing-any-size/ http://blog.qt.io/blog/2017/05/31/qt-lite-qt-5-9-lts/
        • compile Qt statically, with -reduce-relocations
        • compile your app statically
        • enable compiler flag -Os (optimize for size) - for Qt and for your app
        C Offline
        C Offline
        callen
        wrote on last edited by
        #3

        @sierdzio Thanks for you replay.I am trying it now.And as you mention,39760KB is not the QT app consume RAM,it's the VSS memory.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved