Results 1 to 4 of 4

Thread: QThreads and memory overshoot for embedded linux enviroment

  1. #1
    Join Date
    Nov 2009
    Posts
    60
    Thanks
    3
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default QThreads and memory overshoot for embedded linux enviroment

    Dear All,

    We are facing an unusal behaviour of Qt in windows and embedded linux enviroment.

    Our embedded application uses six thread to achive its computing goals. threads consists of RF reader,sensor,keypad,Tcp server,GUI thraed etc.
    so in the main.cpp we create threads and start them,this enters the event loop.

    we found these observations
    1. when we run the applications,memory used in embedded board overshoots to 123% for 64 MB RAM for top command on linux. same application utilizes 24MB of RAM on windows.
    2. When we create and start a dummy thread for test,there is significant change in the memory for embedded linux (approx 13%) while on windows/linux PC the increase is insignificant.

    Qt Code:
    1. our dummy code for test
    2.  
    3. class myThread : public QThread
    4. {
    5. Q_OBJECT
    6. public:
    7. virtual void run();
    8. ~myThread();
    9.  
    10. public slots:
    11.  
    12. private:
    13. Priority pri;
    14. };
    15.  
    16.  
    17.  
    18. int main(int argc, char *argv[])
    19. {
    20. QApplication a(argc, argv,QApplication::GuiServer);
    21. myThread obj1,obj2,obj3;
    22. obj1.start();
    23. obj2.start();
    24. obj3.start();
    25.  
    26. return a.exec();
    27.  
    28. }
    To copy to clipboard, switch view to plain text mode 


    The obove code show significant difference in memory usage for board compared to PC linux

  2. #2
    Join Date
    Nov 2009
    Posts
    60
    Thanks
    3
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QThreads and memory overshoot for embedded linux enviroment

    Hi

    If the message is inadequate/missing i am adding more info below.

    my problem is if I take a Qthread instance and run on embedded linux platform I get change(increase) in memory usage,while on the PC linux there is no change.

    can anyone give your valuable feedback on this.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QThreads and memory overshoot for embedded linux enviroment

    Maybe it help to measure the memory usage with a more reliable tool than top, e.g. exmap http://www.berthels.co.uk/exmap/
    See http://blogs.kde.org/2005/09/15/measuring-memory-usage for a discussion on why top is not really good at producing usage numbers.

    Cheers,
    _

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QThreads and memory overshoot for embedded linux enviroment

    Also it is likely you can reduce the number of threads in your application. For example the TCP server most likely doesn't need its own thread. Other components you mentioned can also work in the main thread if they provide some non-blocking API for checking their state.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Memory leak after deletion of a GStreamer element on embedded linux board
    By qtsmartcoder in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 28th November 2012, 10:11
  2. Replies: 5
    Last Post: 25th April 2012, 11:34
  3. difference between source in Qt for X11/Linux Qt for Embedded Linux
    By sanjeet in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th June 2011, 02:58
  4. Config QT Enviroment For Embedded ?
    By Thành Viên Mới in forum Newbie
    Replies: 1
    Last Post: 4th November 2010, 09:42
  5. Multiple apps using Qt/Embedded+Qtopia on Embedded Linux
    By drahardja in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th February 2008, 21:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.