Computer Specs to Avoid Crashes?

I currently have a quad core Intel Core i5, clocked at 3.3 Ghz, 8 GB RAM and a GTX 960 2 GB.
Everytime I modify a material or use a material\model for the first time (after opening the engine, not just the first time ever) the editor freezes for a few seconds to a few minutes.
When I compile the lighting in a somewhat big level (a not so big terrain, 6x6 components, 63x63 quads, with alot of grass, trees rocks and flowers in it), the compilation process stays at 0% until the entire computer freezes and becomes unusable, and the only way to use it is to force-restart it (with the physical restart button).
I will sell my games on steam at some point, so I want to upgrade my computer, but my financial status is not good, so I wanted to know what specs woud be able to compile big levels (I’ll make much bigger levels than what I’ve mentioned previously) at all, because right now I am not able to do so, and if I wouldn’t need to sell a kidney for these specs that’d also be great.

It’s recompiling shaders so that would improve with a faster CPU. If you have trouble building lighting then the speed depends on your CPU and if it crashes then that’s due to not having enough RAM. Building lighting requires the most memory since it has to load everything to be able to calculate it.

Yeah, lack of memory would be an issue with a big level - you want at least 16GB ideally.

Thank you very much for the quick response!
Since my budget is very low I’d like to just upgrade.
Will a water cooled Intel Core i7-4790K and 32 GB of RAM do?

The memory would be cheapest to improve, but that’s only if running out of memory is the issue. Getting a new CPU will help everything but is more expensive.