Results 1 to 5 of 5

Thread: QProcess and memory usage

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    11
    Thanks
    3
    Qt products
    Qt4

    Default QProcess and memory usage

    Hello everybody,

    I am just working on program that turns out to have a huge memory leak. In this program I use QProcess to start an external program which is generating data that I process in my program. The external programm writes its output to stdout from where I read it with QProcess::readLine(). Reading is triggered by the QProcess::readyReadStandardOutput() signal. The external program creates up to a few hundred MB of data every second. It looks like QProcess never throws that data away after I read the data from stdout, eating up my systems memory.

    Is there a way to free that memory used by QProcess again? But the QProcess has to be active all the time.

    Or is there a fundamental flaw with my concept? Did I make obvious mistakes? I want to move to sockets to get the data in the future, but this is not a option now. I have to wait until the developer of the external program is able to do it. Until then I would like to have my program work with passing data via stdout.

    Thanks in advance.

    (Edit: I am developing on a Linux machine, but I want my program to work on other systems at a later point)
    Last edited by ts66; 8th December 2011 at 19:04.

Similar Threads

  1. Bad memory usage on QWebView I think
    By jiturra in forum Qt Programming
    Replies: 15
    Last Post: 21st January 2014, 20:35
  2. QHash memory usage
    By helloworld in forum Qt Programming
    Replies: 1
    Last Post: 10th December 2010, 21:08
  3. Memory usage of simple Qt app
    By DiamonDogX in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2009, 06:53
  4. CPU Time & Memory Usage in QThread or QProcess
    By Davidaino in forum Qt Programming
    Replies: 0
    Last Post: 11th July 2008, 19:15
  5. CPU and Memory Usage
    By philwinder in forum Qt Programming
    Replies: 16
    Last Post: 17th May 2008, 22:25

Tags for this Thread

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.