-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of memory when compiling 1.0.2 on Raspberry #120
Comments
looks like a meson problem to me, so redsea is not the guilty one here |
i guess you could make it use cmake, just ask chatgpt? |
try this CMakeLists.txt : (note that that was generated by chatgpt)
|
Thanks for your reply. I have no experience in asking machines and do not trust them. The syntax has some errors as some words (like But I have path problems (for example sndfile not found) and will find out in the next days.
|
Thank you for the report. It might be because ninja (used by meson) by default starts a highly parallel run (other discussions: vscode-meson#152 and ninja#1441), which is not good for systems with low RAM. Can you try and replace the compile command with this command:
It limits ninja to only use 1 CPU. The build will take a little longer as a downside. Hope it helps. -O. |
Well, after several attempts I could build it finally. Seems the default installation of https://dietpi.com/ on my Raspberry did not make use of a swap file. After creating it, I could build it (without your hint) in two steps as it crashed after some files. I don't know if we should close the issue or try to improve the installation procedure. Oona, is there (still) an option to disable TMC? |
No, I haven't put a TMC disabling option in the current system. I tried the above command on my RasPi 3 B v1.2 and it compiled okay, although I don't have a windowing system there. We could add it to the Readme, I suggest this addition:
Some other ideas that could be turned into tickets (I haven't tested their memory impact):
Edit, still one option is to do a cross-compilation for Raspberry Pi. It's common in the embedded world to compile code on a more resourceful machine, and then just copy the binaries to the target; for instance, on modern M1 arm64 redsea would compile in around 10 seconds. But it's something I haven't researched yet, what kind of setup it would require to cross-compile in meson. For sure at least a cross-compilation toolchain is required on the compiler machine, something like this. -O. |
Well, the only main solution is more RAM or a swap file. It also seems to be depending on the Debian version. Because I remember I could compile it on the same Raspberry on older Debian (Buster or Strech, don't remember).
|
You might want to exit any graphical software that is taking up a lot of RAM before compilation. Currently it requires around 500 MB of memory with You can check the amount of free memory with Just for curiosity's sake, I made this Excel graph of how the redsea compilation uses memory on my RasPi 3B on Debian Buster. The Debian system on the RasPi uses 38 MB in itself if the desktop is not running. Then we start the compile. Pink text, which is roughly what is being compiled at that time (pink lines are placed artistically in Y, does not correspond to the MB scale), show one of the the 500 MB peaks is during locationdb compilation So if a TMC disablement flag would be implemented the peak could probably go down to ~350 MB (guessing). |
I have good news, I could compile the new 1.1.0 on the same machine (Raspberry Pi 3B+), but downloaded and installed a different OS in 32bit than before (which was dietpi 64bit distribution, which I do not recommend to others). Have used the Therefore, closing. |
Great stuff, congrats! |
will avoid out of memory and freezing/rebooting on Raspberry PI 3B+ with only 1 GB RAM see windytan/redsea#120
Dear Oona,
I had to reinstall my Raspberry Pi 3B+ but could not install latest 1.0.2 with meson due to out of memory during compilation. Using a GUI, after some minutes the complete x-server crashes and restarts.
I tried it around 20 times, but even booting the RPi without GUI did not help here, the system looks like frozen, the cursor blinks but I even cannot open another logon shell (
ctrl
+alt
+F2
will blink as well). And I also tried to add some parameters like-Ddebug=false
or-Dbuildtype=minsize
from https://mesonbuild.com/Builtin-options.htmlBTW: Building 0.21 (the last one without meson) was successful.
The following log below is after around 30 minutes (when I killed the process by pressing
ctrl
+c
) still trying to compile 0/15.Do you have an idea or advice me to log anything else?
Is there any chance that I can use
cmake
like before?Unfortunately, it is not possible to log everything with
script
, so I needed to take these two pictures.The text was updated successfully, but these errors were encountered: