If colcon build --symlink-install --executor sequential
also didn't solve your problem either, you can try the commands below:
export MAKEFLAGS="-j 1"
colcon build --executor sequential
The -j option allows you to specify the number of jobs that make shouldwhich run in parallel. Each job can be run on a separate CPU core, which can significantly speed up the build process on multi-core systems.
Note: You can change the variable, it doesn't need to be 1.
Be aware that you will increase the chance of freezing every time you increase the variable but in the other hands, building time will be increase every time you decrease the variable. You can see the effect of building the project on your system with htop
command in another terminal.