If you are using Sandbox Solutions you need the User Code Service to make them work. If you don't then turn it off. That service, along with the associated host controller, creates a new process for each instance of your sandbox solution. The more solutions you deploy, the more RAM you will need.
Generally, on a development box, with Visual Studio, you would want 16-24 GB RAM.
If you spin up the Search Service it will spin up 6 processes that will eat your RAM. Again, if you don't need search in development, don't create the service application. If you do, dial down the performance level so you are not impacted.