Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtSerialPort and memory usage
QtWS25 Last Chance

QtSerialPort and memory usage

Scheduled Pinned Locked Moved General and Desktop
serialport
18 Posts 3 Posters 7.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.
  • mrjjM mrjj

    Hmm if tera works with same usb serial then it cant be the driver.
    Im also using serial over usb.

    Tried to run updated code. just to ebe sure.
    get link error
    undefined reference to `GetProcessMemoryInfo@12'

    What should i put in .pro to run ?
    something with -lpsapi.
    Mostly on linux so not sure with syntax

    C Offline
    C Offline
    codeaway
    wrote on last edited by
    #7

    @mrjj

    Yes.

    Sorry, missed the .pro file. inlined it

    #-------------------------------------------------

    Project created by QtCreator 2015-10-06T21:35:43

    #-------------------------------------------------

    win32:LIBS += -lpsapi

    QT += core serialport

    QT -= gui

    TARGET = Serial
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #8

      works.
      Still stable.
      Do you have input on the serial ?
      I will connect something that sends data. just to check.
      How do you make it open console also ?
      Here its just a process.
      Update:
      ignore last question. just saw its QDebug
      Also, with input , I do see mem raising.
      Testing more

      C 1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #9

        ok,
        slowly from 12k to 17k. over time when it has input.
        Also the pmc changes.
        So yes. I see the same.
        Will leave it running for some time to check if it stops.

        1 Reply Last reply
        0
        • mrjjM mrjj

          works.
          Still stable.
          Do you have input on the serial ?
          I will connect something that sends data. just to check.
          How do you make it open console also ?
          Here its just a process.
          Update:
          ignore last question. just saw its QDebug
          Also, with input , I do see mem raising.
          Testing more

          C Offline
          C Offline
          codeaway
          wrote on last edited by
          #10

          @mrjj

          Yes, I do have a microcontroller reading values and outputting to serial port
          continuously.

          Actually, the application I created is a console application. The info is output
          with QDebug additionally.

          Nevertheless, you can choose to output with console without QDebug too.

          CONFIG += console

          in the .pro file

          Create a output stream in the actual code

          QTextStream out(stdout);

          and output whatever required

          out << "Something" << endl;

          mrjjM 1 Reply Last reply
          0
          • C codeaway

            @mrjj

            Yes, I do have a microcontroller reading values and outputting to serial port
            continuously.

            Actually, the application I created is a console application. The info is output
            with QDebug additionally.

            Nevertheless, you can choose to output with console without QDebug too.

            CONFIG += console

            in the .pro file

            Create a output stream in the actual code

            QTextStream out(stdout);

            and output whatever required

            out << "Something" << endl;

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #11

            @codeaway
            Ok i killed it at 25K.
            Since we just reading a char, it cant be in the us that leaks.

            I must agree it seems odd.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kuzulis
              Qt Champions 2020
              wrote on last edited by
              #12

              Can you please test same with the virtual com0com: http://sourceforge.net/projects/com0com/
              A signed driver for x64: https://code.google.com/p/powersdr-iq/downloads/detail?name=setup_com0com_W7_x64_signed.exe&can=2&q=

              C mrjjM 2 Replies Last reply
              0
              • K kuzulis

                Can you please test same with the virtual com0com: http://sourceforge.net/projects/com0com/
                A signed driver for x64: https://code.google.com/p/powersdr-iq/downloads/detail?name=setup_com0com_W7_x64_signed.exe&can=2&q=

                C Offline
                C Offline
                codeaway
                wrote on last edited by
                #13

                @kuzulis

                I downloaded the x86 build, as I am running a 32 bit OS.
                How should I configure com0com ?

                1 Reply Last reply
                0
                • K kuzulis

                  Can you please test same with the virtual com0com: http://sourceforge.net/projects/com0com/
                  A signed driver for x64: https://code.google.com/p/powersdr-iq/downloads/detail?name=setup_com0com_W7_x64_signed.exe&can=2&q=

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #14

                  @kuzulis
                  just as a virtual port or as a loop ?

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kuzulis
                    Qt Champions 2020
                    wrote on last edited by
                    #15

                    How should I configure com0com ?

                    Just create a pair with the "use port class" and "eneble buffer overrun" (via setupg.exe ui)

                    just as a virtual port or as a loop ?

                    as a two virtual ports. . e.g. COM1 as receiver for qserialport and COM2 as sender for other software (e.g. I have used Termite app to send).

                    UPD:

                    Yes, I too can reproduce this memory leak..

                    C 1 Reply Last reply
                    0
                    • K kuzulis

                      How should I configure com0com ?

                      Just create a pair with the "use port class" and "eneble buffer overrun" (via setupg.exe ui)

                      just as a virtual port or as a loop ?

                      as a two virtual ports. . e.g. COM1 as receiver for qserialport and COM2 as sender for other software (e.g. I have used Termite app to send).

                      UPD:

                      Yes, I too can reproduce this memory leak..

                      C Offline
                      C Offline
                      codeaway
                      wrote on last edited by
                      #16

                      @kuzulis

                      Yeah, reproduced it with com0com and termite.
                      Attached link to screencap

                      http://postimg.org/image/mku4ege29/

                      After a detailed analysis, it looks as though all QtSerialPort examples
                      also face this issue.

                      mrjjM 1 Reply Last reply
                      0
                      • C codeaway

                        @kuzulis

                        Yeah, reproduced it with com0com and termite.
                        Attached link to screencap

                        http://postimg.org/image/mku4ege29/

                        After a detailed analysis, it looks as though all QtSerialPort examples
                        also face this issue.

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #17

                        @codeaway
                        Yep got ever increasing mem use also with com0com.
                        If time permits I try the examples too.

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          kuzulis
                          Qt Champions 2020
                          wrote on last edited by
                          #18

                          Probably it is a bug of QWinOverlappedIoNotifier : https://bugreports.qt.io/browse/QTBUG-48653
                          Let's wait for more info about..

                          1 Reply Last reply
                          1

                          • Login

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