Colcon build --packages-up-to ardupilot_gz_bringup screen freeze

When i was following the documentation of Ros2 with gazebo
https://ardupilot.org/dev/docs/ros2-gazebo.html
And when i ran this command colcon
build --packages-up-to ardupilot_gz_bringup
After 10/13 my screen got freezed and i have to restart again. But everytime i got the same error. So any idea how to solve this.

@Rohan2 it could be that your system has run out of RAM for the build. colcon will build in parallel using all available cores if it can. What machine and OS are you using?