A project build on Raspbian.
-
If you are building with all cores, try keeping one idle (
make -j 3
instead ofmake -j 4
). This should lower the amount of RAM consumed by the compiler. -
@jenya7 said in A project build on Raspbian.:
Where I configure it "make -j 3"
When you call make
make -j 4
Do you compile in a terminal or in QtCreator?
If in QtCreator then go to "Projects/Build/Build Steps" and set the number of parallel jobs. -
It could be a Qt bug. Mine on Ubuntu freezes sometimes as well. It could also be the case that too many other apps are running. Try to build it from command line which looks even faster. Get into the build folder which you can find it from Qt creator and run the command: make -j3.
I use qt creator only for editing and debugging. But compile from command line.
-
Why should it be a Qt bug when the OS freezes because it has to swap out the memory / has memory pressure? A single gcc process will easily use 1GB when compiling Qt so don't execute that much gcc processes at the same time when you're low on memory.
-
@Christian-Ehrlicher No other app causes this. So it must be a qt bug. Even when it swaps memory, it should keep going. It simply freezes.
-
@JoeCFD said in A project build on Raspbian.:
So it must be a qt bug.
Did you really read my answer about the memory usage of a compiler instance? I guess not... there is nothing Qt (or in this case QtCreator...) can do about low memory or the memory usage of a compiler. When you spawn 4 processes which takes more than 1GB at least then you will have a hard time with only 4GB of RAM.
-
@Christian-Ehrlicher BTW, how could build cause memory problem?
-
Hi,
Building code can be very memory hungry depending on a lot independent things such as your actual code base, the number of libraries you use, the number of headers your include, the content of the headers you include, etc. Building is not just translating your text file to machine code.
-
@JoeCFD said in A project build on Raspbian.:
@SGaist True. I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.
How do I build from a command line?
-
@JoeCFD said in A project build on Raspbian.:
I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.
This is nonsense - there is no difference if you call
make
or whatever from the command line or from QtCreator.With 4 threads, make uses about 10% of total memory. But my app needs more than that.
And how do you know the RAM size of the OP? How do you know what headers and libraries are used?
Stop spreading fud!
-
@Christian-Ehrlicher said in A project build on Raspbian.:
@JoeCFD said in A project build on Raspbian.:
I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.
This is nonsense - there is no difference if you call
make
or whatever from the command line or from QtCreator.May be the GUI itself loads some extra?