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. Qt MSVC 2015 Compiler Are Used All Memory Of My System
Forum Updated to NodeBB v4.3 + New Features

Qt MSVC 2015 Compiler Are Used All Memory Of My System

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 7 Posters 1.6k Views 2 Watching
  • 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.
  • Ketan__Patel__0011K Ketan__Patel__0011

    My Qt Version Is : 5.12.3

    Details : When I Build My Qt Program That Time It Will Used All Memory Of My System

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #4

    @Ketan__Patel__0011 Why do you think this is bad? RAM is there to be used. The compiler uses as much RAM as is available. As long as the RAM is released after compilation I don't see how this is an issue.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    JonBJ 1 Reply Last reply
    0
    • jsulmJ jsulm

      @Ketan__Patel__0011 Why do you think this is bad? RAM is there to be used. The compiler uses as much RAM as is available. As long as the RAM is released after compilation I don't see how this is an issue.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #5

      @jsulm said in Qt MSVC 2015 Compiler Are Used All Memory Of My System:

      The compiler uses as much RAM as is available. As long as the RAM is released after compilation I don't see how this is an issue.

      Try attempting to start up e.g. Word while compilation is running and using all RAM if you don't think this is an issue! :) All processes should have the amount of RAM they can help themselves to limitable. I'm not saying this has any particular relevance to OP's situation. And anyway this looks like an MSVC issue, not Qt. I used MSVC for years and can't say I ever noticed it taking all RAM, even on large projects.

      jsulmJ 1 Reply Last reply
      0
      • Ketan__Patel__0011K Ketan__Patel__0011

        My Qt Version Is : 5.12.3

        Details : When I Build My Qt Program That Time It Will Used All Memory Of My System

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #6

        @Ketan__Patel__0011 said in Qt MSVC 2015 Compiler Are Used All Memory Of My System:

        Details : When I Build My Qt Program That Time It Will Used All Memory Of My System

        You need to give more details about your program. Ironically I have the same problem with gcc currently, but it's my own fault - I have an unending recursion in template instantiation which I need to fix.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        2
        • mrjjM mrjj

          Hi
          How much memory do you have?
          8 GB is a minimum for a dev station running win 10.

          Ketan__Patel__0011K Offline
          Ketan__Patel__0011K Offline
          Ketan__Patel__0011
          wrote on last edited by Ketan__Patel__0011
          #7

          Problem.png

          You Can See When I Start The Build It will taking More Then 3GB RAM
          And Still Project Build is Not Complete

          mrjjM 1 Reply Last reply
          1
          • Ketan__Patel__0011K Ketan__Patel__0011

            Problem.png

            You Can See When I Start The Build It will taking More Then 3GB RAM
            And Still Project Build is Not Complete

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

            @Ketan__Patel__0011
            Hi
            So you have 4 GB mem in all ?

            Did the project used to compile before ?

            Did you add some huge bitmaps lately or anything like that ?

            Ketan__Patel__0011K 1 Reply Last reply
            1
            • JonBJ JonB

              @jsulm said in Qt MSVC 2015 Compiler Are Used All Memory Of My System:

              The compiler uses as much RAM as is available. As long as the RAM is released after compilation I don't see how this is an issue.

              Try attempting to start up e.g. Word while compilation is running and using all RAM if you don't think this is an issue! :) All processes should have the amount of RAM they can help themselves to limitable. I'm not saying this has any particular relevance to OP's situation. And anyway this looks like an MSVC issue, not Qt. I used MSVC for years and can't say I ever noticed it taking all RAM, even on large projects.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #9

              @JonB So, you think the compiler should not use all available free RAM? How much should it use? It is the responsibility of the OS to distribute RAM across all running processes. If you start some other application while compiling OS should handle that. On my machine I can use other applications while compiling a big project without issues (Linux).

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              JonBJ 1 Reply Last reply
              0
              • jsulmJ jsulm

                @JonB So, you think the compiler should not use all available free RAM? How much should it use? It is the responsibility of the OS to distribute RAM across all running processes. If you start some other application while compiling OS should handle that. On my machine I can use other applications while compiling a big project without issues (Linux).

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #10

                @jsulm
                I think something like a compiler, which could use a large amount of memory probably in cache buffers, has (ought to have) a responsibility to allow itself to be limited to a certain amount, so that other processes have a chance to use some free RAM, yes.

                [I note that there are quite a few posts out there on the web from people asking how to limit, say, gcc memory usage because of "running out of space" issues. Just saying. Looks like I'm over optimistic about it having support for limiting its usage. Anyway, in real possibility for the OP, some talk about needing to limit make -j<num>, not because of threads/cores but because of RAM. I don't know if Qt Creator build uses make [-j].]

                If I didn't care about other processes I wouldn't necessarily bother to free program objects as I went along, I could leave it just using them until program exit [assume my own program does run out of memory itself] and tell the user/OS to find some other free memory, or I could choose algorithms which use much memory. But I'm a good OS citizen, so I do free as I go along, and even though it might suit me to hold everything in memory for just my program I do use files where appropriate instead, etc.

                The OP is under Windows. Windows does not offer the same memory management governance as Linux. In practice I haven't seen a working setrlimit under Windows. I wasn't so much saying about using another program --- which may already be in memory --- I was saying about trying to start another program, which can in practice be blocked by no free RAM.

                Having said that, I have watched my Linux box (VM under Windows) where a process has taken up all RAM, then swap space. It is not a pretty sight. Hard reboot required from frozen machine. Should it happen under Linux that it gets to this state? Probably not. But it does. Have you tested system behaviour if you write a program which keeps allocating memory till all physical + swap space is used up, and then try to go off and do other things, including interacting with the desktop?

                So perhaps your experiences differ from mine.

                jsulmJ 1 Reply Last reply
                0
                • mrjjM mrjj

                  @Ketan__Patel__0011
                  Hi
                  So you have 4 GB mem in all ?

                  Did the project used to compile before ?

                  Did you add some huge bitmaps lately or anything like that ?

                  Ketan__Patel__0011K Offline
                  Ketan__Patel__0011K Offline
                  Ketan__Patel__0011
                  wrote on last edited by
                  #11

                  @mrjj I Have Total 8GB Memory And
                  I Just Used Only two or three images in My Project

                  J.HilkJ 1 Reply Last reply
                  0
                  • Ketan__Patel__0011K Ketan__Patel__0011

                    @mrjj I Have Total 8GB Memory And
                    I Just Used Only two or three images in My Project

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by
                    #12

                    @Ketan__Patel__0011
                    can you upload that project so we could try ourself?


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    Ketan__Patel__0011K 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @jsulm
                      I think something like a compiler, which could use a large amount of memory probably in cache buffers, has (ought to have) a responsibility to allow itself to be limited to a certain amount, so that other processes have a chance to use some free RAM, yes.

                      [I note that there are quite a few posts out there on the web from people asking how to limit, say, gcc memory usage because of "running out of space" issues. Just saying. Looks like I'm over optimistic about it having support for limiting its usage. Anyway, in real possibility for the OP, some talk about needing to limit make -j<num>, not because of threads/cores but because of RAM. I don't know if Qt Creator build uses make [-j].]

                      If I didn't care about other processes I wouldn't necessarily bother to free program objects as I went along, I could leave it just using them until program exit [assume my own program does run out of memory itself] and tell the user/OS to find some other free memory, or I could choose algorithms which use much memory. But I'm a good OS citizen, so I do free as I go along, and even though it might suit me to hold everything in memory for just my program I do use files where appropriate instead, etc.

                      The OP is under Windows. Windows does not offer the same memory management governance as Linux. In practice I haven't seen a working setrlimit under Windows. I wasn't so much saying about using another program --- which may already be in memory --- I was saying about trying to start another program, which can in practice be blocked by no free RAM.

                      Having said that, I have watched my Linux box (VM under Windows) where a process has taken up all RAM, then swap space. It is not a pretty sight. Hard reboot required from frozen machine. Should it happen under Linux that it gets to this state? Probably not. But it does. Have you tested system behaviour if you write a program which keeps allocating memory till all physical + swap space is used up, and then try to go off and do other things, including interacting with the desktop?

                      So perhaps your experiences differ from mine.

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #13

                      @JonB Sorry, I still do not see why compiler should limit itself. If there is free RAM it can be used. If some other application needs RAM OS will handle that. Maybe Windows is not that good at that (I don't develop on Windows), but on Linux I would not want to limit RAM usage for the compiler without a reason.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      JonBJ 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @JonB Sorry, I still do not see why compiler should limit itself. If there is free RAM it can be used. If some other application needs RAM OS will handle that. Maybe Windows is not that good at that (I don't develop on Windows), but on Linux I would not want to limit RAM usage for the compiler without a reason.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #14

                        @jsulm
                        May I just ask how you find your OS/machine behaves if you write a program which continues allocating memory till no free memory and no swap space left? My Ubuntu simply freezes/dies. This is purely OOI, I'd like to hear.

                        Meanwhile, since these compilers do not offer to limit memory themselves, I accept that is how it is. In the OP's case it may be moot, as it does not look like his 4GB is enough to accommodate Creator/compilation on his project either at all or comfortably.

                        jsulmJ 1 Reply Last reply
                        0
                        • J.HilkJ J.Hilk

                          @Ketan__Patel__0011
                          can you upload that project so we could try ourself?

                          Ketan__Patel__0011K Offline
                          Ketan__Patel__0011K Offline
                          Ketan__Patel__0011
                          wrote on last edited by
                          #15

                          @J-Hilk Sorry I Can't Upload My Whole Project

                          1 Reply Last reply
                          0
                          • fcarneyF Offline
                            fcarneyF Offline
                            fcarney
                            wrote on last edited by
                            #16

                            @Ketan__Patel__0011 said in Qt MSVC 2015 Compiler Are Used All Memory Of My System:

                            Sorry I Can't Upload My Whole Project

                            Create a minimal project that replicates the issue. You will probably find a solution while doing this.

                            C++ is a perfectly valid school of magic.

                            1 Reply Last reply
                            2
                            • JonBJ JonB

                              @jsulm
                              May I just ask how you find your OS/machine behaves if you write a program which continues allocating memory till no free memory and no swap space left? My Ubuntu simply freezes/dies. This is purely OOI, I'd like to hear.

                              Meanwhile, since these compilers do not offer to limit memory themselves, I accept that is how it is. In the OP's case it may be moot, as it does not look like his 4GB is enough to accommodate Creator/compilation on his project either at all or comfortably.

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #17

                              @JonB said in Qt MSVC 2015 Compiler Are Used All Memory Of My System:

                              if you write a program which continues allocating memory till no free memory and no swap space left?

                              This is not how the compiler behaves. It uses available memory. I never had freezes while compiling. The system can get a bit laggy sometimes, but that's all.

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              JonBJ 1 Reply Last reply
                              0
                              • jsulmJ jsulm

                                @JonB said in Qt MSVC 2015 Compiler Are Used All Memory Of My System:

                                if you write a program which continues allocating memory till no free memory and no swap space left?

                                This is not how the compiler behaves. It uses available memory. I never had freezes while compiling. The system can get a bit laggy sometimes, but that's all.

                                JonBJ Offline
                                JonBJ Offline
                                JonB
                                wrote on last edited by JonB
                                #18

                                @jsulm
                                All I meant was use available memory, I don't see how I implied otherwise. You may never have had freezes because your compilation didn't need to use all available memory. Oh well. :)

                                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