Morgan Stanley Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
simply speed of access of various memory devices are in the order
register > cache > RAM > hard-drive
Now, when you are running multiple processes on the system process switching keeps on happening.
When a new process is scheduled for execution and there is not enough memory in RAM to keep the previous one ,the process is swapped out to disk which is a slower memory than RAM.This swapping out is a wastage of time.
Later when the old process is rescheduled to execute, it again needs to be swapped in from the slower hard-drive. This is a wastage of time. While the process is being swapped in or out the processor remains idle. Hence, it is not desirable and we prefer to have larger RAM sizes to avoid keeping the processor idle.
Well obvious reason is less moving in/out processes from RAM to disk/disk to RAM since disk I/O is extremely slow comparing to CPU speed or even RAM speed. I don't know what other clarification you have got but I will assume single process takes at most 2GB and you are running multiple processes simultaneously.
- Alex L February 19, 2014