Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-102754

moc memory usage

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Build tools: moc
    • None

    Description

      I downloaded different binary distributions of Qt on my x86_64 Linux box, using Qt's online installer. Then I executed (several times) for each version this specific moc command line:

      $MOC  \
          -DBACKTRACE_HEADER="execinfo.h" -DCore_EXPORTS -DELF_INTERPRETER="/lib64/ld-linux-x86-64.so.2" -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS \
          -DQT_DEPRECATED_WARNINGS_SINCE=0x070000 -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS \
          -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_USING_NAMESPACE -DQT_STRICT_QLIST_ITERATORS -DQT_TYPESAFE_FLAGS -DQT_USE_QSTRINGBUILDER -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE \
          -I$OBJ/include -I$OBJ/include/QtCore -I$SRC/src/corelib -I$OBJ/src/corelib -I$OBJ/src/corelib/global -I$OBJ/src/corelib/kernel -I$SRC/src/3rdparty/tinycbor/src -I$OBJ/include/QtCore/6.4.0 \
          -I$OBJ/include/QtCore/6.4.0/QtCore -I$SRC/src/3rdparty/double-conversion/double-conversion -I$SRC/src/3rdparty/double-conversion -I$SRC/src/3rdparty/forkfd -I$OBJ/src/corelib/.rcc \
          -I$OBJ/mkspecs/linux-g++ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include -I/usr/include/c++/11 -I/usr/include/c++/11/x86_64-suse-linux -I/usr/include/c++/11/backward \
          -I/usr/lib64/gcc/x86_64-suse-linux/11/include -I/usr/local/include -I/usr/lib64/gcc/x86_64-suse-linux/11/include-fixed -I/usr/x86_64-suse-linux/include \
          --include $OBJ/src/corelib/Core_autogen/moc_predefs.h \
          --output-json --output-dep-file \
          -o moc_qtemporaryfile.cpp $SRC/src/corelib/io/qtemporaryfile.h
      

      The variables SRC and OBJ are the same for all my runs and point to qtbase-dev (to be 6.4 branch) source and object directories respectively.

      Results

      • 6.3.0/gcc_64/libexec/moc
        0.14user 0.03system 0:00.18elapsed 99%CPU (0avgtext+0avgdata 59232 maxresident)k
        0inputs+64outputs (0major+16235minor)pagefaults 0swaps
      • 6.2.4/gcc_64/libexec/moc
        0.15user 0.03system 0:00.18elapsed 99%CPU (0avgtext+0avgdata 61316 maxresident)k
        0inputs+64outputs (0major+15166minor)pagefaults 0swaps
      • 6.0.4/gcc_64/bin/moc
        0.16user 0.03system 0:00.20elapsed 99%CPU (0avgtext+0avgdata 59184 maxresident)k
        0inputs+64outputs (0major+15266minor)pagefaults 0swaps
      • 5.15.9/gcc_64/bin/moc
        0.12user 0.02system 0:00.14elapsed 100%CPU (0avgtext+0avgdata 41044 maxresident)k
        0inputs+64outputs (0major+6004minor)pagefaults 0swaps
      • 5.12.12/gcc_64/bin/moc ( NOTE: no --output-json --output-dep-file )
        0.11user 0.01system 0:00.13elapsed 99%CPU (0avgtext+0avgdata 38612 maxresident)k
        0inputs+8outputs (0major+6341minor)pagefaults 0swaps
      • 5.9.9/gcc_64/bin/moc ( NOTE: no --output-json --output-dep-file )
        0.11user 0.02system 0:00.13elapsed 99%CPU (0avgtext+0avgdata 38128 maxresident)k
        0inputs+8outputs (0major+6219minor)pagefaults 0swaps

      It seems there is a significant increase in the memory usage introduced with Qt 6.0. Without further profiling I can't tell what it might be (code size or data). I wonder if moc changed significantly between these two versions.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fabiankosmale Fabian Kosmale
            jimis Dimitrios Apostolou
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes