World's most popular travel blog for travel bloggers.

[Solved]: Difference between virtual memory and job pool

, , No Comments
Problem Detail: 

Both virtual memory and job pools store the processes temporarily on disk and bring them to memory at some later stage, so what is the actual difference in between them?

What I guess is that when a process is just created, it first goes to the job pool and then it is sent to the ready queue. Virtual memory is only used when available memory becomes smaller than the required memory for any process (please correct me if I am wrong).

If this is the case then doesn't it decrease performance? What is the need to store processes in job pool first? Why don't we send processes directly to memory?

Also somewhere it was written as "job contains the list of all the jobs in the system and jobs in the memory are a subset of the jobs in the job pool". So what is meant by "all jobs in the system" here? Does it mean "all NEW jobs"?

Asked By : swdeveloper

Answered By : azam

All the jobs that enter the system are kept in the job pool. This pool consists of all processes residing on mass storage awaiting allocated of main memory. (Source)

When a job has to get executed, it needs to be residing in the main memory. But, due to the limitation of size of main memory, only the parts of job which are currently being executed are transferred onto main memory, and the rest reside in virtual memory.

So, in short, jobs which are created are sent to the job pool and are waiting to get their required resources and to get executed.

Why don't we send processes directly to memory?

Not always, is the main memory free. So, the job scheduler comes into the picture.

Because it is the job of the job scheduler to pick jobs from the job pool. Because, by default the job scheduler must be using some heuristic to schedule jobs i.e. according to priority or FIFO etc. You cannot break the custom and force it directly to the main memory, as that is the job of the job scheduler. This process, might have a bit of performance overhead, I understand, but things are pretty organised this way (the OS is so designed), and ensures no process starves.

All the jobs in the system mean the jobs in the hard disk and the jobs in the main memory combined. So, jobs in the memory are a subset of the total jobs in the 'system'.

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/51999

0 comments:

Post a Comment

Let us know your responses and feedback