Something within Mame's code is causing cc1plus.exe to memory leak when it compiles at the emumem files (at least on my end). It shouldn't have to use >10 GB of ram just to compile Mame.Didn't mean to say 10GB b/c that was from compiling under -j5.
So the "j" setting from my examination determines how much instances of cc1plus are used when compiling Mame. I decided to check memory behavior for only one cc1plus instance and the memory used for this application just kept rising until it was finished with an emumem file. Highest I seen it go up to so far was about 5 GB of ram used compiling emumem_mview.cpp.
What I did was use Resource Monitor to inspect cc1plus.exe's memory usage. Wait until cc1plus compiles the emumem files and watch the ram usage rise.