solanasolana-clisolana-program-library

Solana build crashing on the compilation of solana-validator package


super new to Solana. Trying to get the cloned repo build on my local machine. But the build stops while compiling solana-validator package and the terminal closes itself (crashes if you will) without showing any error or warning. screenshot

Nothing can be seen on the logs either. Tried cargo build --verbose. Nothing. I have Ubuntu 22.04 OS with 15GB RAM and 500GB SSD. So I reckon I have enough resources to get it build. Any ideas why I could be facing this issue?

These are the versions I have installed :

  1. rustup - 1.24.0
  2. rustc - 1.60.0
  3. solana-cli - 1.11.0
  4. nodejs - 16.15.0

Thank you!


Solution

  • This is totally normal, especially with 15GB of RAM -- cargo defaults to spinning up N jobs, where N is the number of cores on your machine. With a lot of cores, it's easy to use up too much memory while trying to compile so many modules in parallel, causing the OOM killer on Linux to take down processes until memory is recovered.

    To get around this, you can start with cargo build --jobs 1, which should succeed. If you want to speed up, feel free to experiment with larger numbers, but know that it might fail again!