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.4k 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.
  • K Offline
    K Offline
    Ketan__Patel__0011
    wrote on 10 Feb 2020, 12:20 last edited by
    #1

    My Qt Version Is : 5.12.3

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

    J J K 3 Replies Last reply 10 Feb 2020, 14:07
    -1
    • K Ketan__Patel__0011
      10 Feb 2020, 12:20

      My Qt Version Is : 5.12.3

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

      J Offline
      J Offline
      JonB
      wrote on 10 Feb 2020, 14:07 last edited by JonB 2 Oct 2020, 14:08
      #2

      @Ketan__Patel__0011
      We don't know how much memory you have, we don't know how much of it is free, we don't know whether you get an error message, we don't know how big your code is. So what sort of answer are you expecting?

      1 Reply Last reply
      4
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 10 Feb 2020, 14:07 last edited by
        #3

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

        K 1 Reply Last reply 11 Feb 2020, 14:27
        4
        • K Ketan__Patel__0011
          10 Feb 2020, 12:20

          My Qt Version Is : 5.12.3

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

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 11 Feb 2020, 08:14 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

          J 1 Reply Last reply 11 Feb 2020, 08:41
          0
          • J jsulm
            11 Feb 2020, 08:14

            @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.

            J Offline
            J Offline
            JonB
            wrote on 11 Feb 2020, 08:41 last edited by JonB 2 Nov 2020, 08:45
            #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.

            J 1 Reply Last reply 12 Feb 2020, 06:12
            0
            • K Ketan__Patel__0011
              10 Feb 2020, 12:20

              My Qt Version Is : 5.12.3

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

              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 11 Feb 2020, 09:03 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
              • M mrjj
                10 Feb 2020, 14:07

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

                K Offline
                K Offline
                Ketan__Patel__0011
                wrote on 11 Feb 2020, 14:27 last edited by Ketan__Patel__0011 2 Nov 2020, 14:28
                #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

                M 1 Reply Last reply 11 Feb 2020, 14:48
                1
                • K Ketan__Patel__0011
                  11 Feb 2020, 14:27

                  Problem.png

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

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 11 Feb 2020, 14:48 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 ?

                  K 1 Reply Last reply 12 Feb 2020, 09:56
                  1
                  • J JonB
                    11 Feb 2020, 08:41

                    @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.

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 12 Feb 2020, 06:12 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

                    J 1 Reply Last reply 12 Feb 2020, 08:30
                    0
                    • J jsulm
                      12 Feb 2020, 06:12

                      @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).

                      J Offline
                      J Offline
                      JonB
                      wrote on 12 Feb 2020, 08:30 last edited by JonB 2 Dec 2020, 09:02
                      #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.

                      J 1 Reply Last reply 12 Feb 2020, 10:01
                      0
                      • M mrjj
                        11 Feb 2020, 14:48

                        @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 ?

                        K Offline
                        K Offline
                        Ketan__Patel__0011
                        wrote on 12 Feb 2020, 09:56 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 12 Feb 2020, 09:57
                        0
                        • K Ketan__Patel__0011
                          12 Feb 2020, 09:56

                          @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 12 Feb 2020, 09:57 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.

                          K 1 Reply Last reply 12 Feb 2020, 13:53
                          0
                          • J JonB
                            12 Feb 2020, 08:30

                            @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.

                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 12 Feb 2020, 10:01 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

                            J 1 Reply Last reply 12 Feb 2020, 10:25
                            0
                            • J jsulm
                              12 Feb 2020, 10:01

                              @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.

                              J Offline
                              J Offline
                              JonB
                              wrote on 12 Feb 2020, 10:25 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.

                              J 1 Reply Last reply 13 Feb 2020, 07:22
                              0
                              • J.HilkJ J.Hilk
                                12 Feb 2020, 09:57

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

                                K Offline
                                K Offline
                                Ketan__Patel__0011
                                wrote on 12 Feb 2020, 13:53 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 12 Feb 2020, 16:12 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
                                  • J JonB
                                    12 Feb 2020, 10:25

                                    @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.

                                    J Offline
                                    J Offline
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on 13 Feb 2020, 07:22 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

                                    J 1 Reply Last reply 13 Feb 2020, 08:00
                                    0
                                    • J jsulm
                                      13 Feb 2020, 07:22

                                      @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.

                                      J Offline
                                      J Offline
                                      JonB
                                      wrote on 13 Feb 2020, 08:00 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

                                      1/18

                                      10 Feb 2020, 12:20

                                      • Login

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