I would not recommend this route. For a similar investment you can get a nice desktop. It won't have as many cores, but overall more powerful and a lot easier to administer. Because of the amount of work that icecream needs to do locally you run into diminishing returns as you add cores to the icecream network, so I question the ability of your existing computer to feed all of these CPUs you are proposing to buy. Your limits will be disk speed (get a SSD) to get data, local CPU speed to preprocess and link, and network bandwidth. Thus adding a new powerful desktop and using it for icecream is your safest investment. In the best case you use your existing computer and the new one to increase compile speeds. In the worst case you discover that your bottleneck isn't the CPU at all and so you can retire the old computer.
How much RAM you need depends on what you are building. hello world needs a lot less ram than Chrome. Modern C++ with a lot of headers can need more than 2GB of ram. I haven't done any benchmarks of your code so I cannot comment other than to say that these days I wouldn't consider it enough.