How do I fix SQL Server assembly optimization errors and memory exhaustion?
This problem is described on Connect (see msiexec.exe processes keep running after installation of SQL Server 2012 SP1) and a hotfix is available at KB2793634. There is commentary on work-arounds on Connect and this blog if you are unable to install the hotfix immediately.

I chose to setup 2 scripts.  1st script runs daily at 1am, and set to terminate after 1 hour of execution

c:\windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe executequeueditems
c:\windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe executequeueditems
c:\windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe executequeueditems 
c:\windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe executequeueditems


2nd script runs daily at 3am (and whenever the computer restarts):

c:\windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe queue pause
c:\windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe queue pause


This way I still get compile optimization jobs (only run during off-peak hours), but the mscorsvw/msiexec process is tamed.