Limit on the system-wide address space in Unix ..

On 32-bit systems, processes are allowed to have upto a maximum of 2^32 bytes of address space ...Assume that process A is consuming this entire range of address space (4GB) ...My question is :

1. Is there any limit on the number of processes similar to Process A? On a 32 bit system, can we have as many process as we want each consuming 4GB of address space SIMULTANEOUSLY ? (consider for now that there is lots and lots of paging space and swapping/performance is not an issue ..)

2. If there is a limit (OS related), why is that limit due to?
Who is Participating?
chris_calabreseConnect With a Mentor Commented:
The only theoretical limit I can think of is that the kernel can't grow bigger than 4gig.  Since each process has kernel memory for file table entries, process table entries, paging table entries, etc, etc. there will be an upper bound.

Also, there may be hardware limits on the total page table sizes due to the structures used to hold them.
srivatsa_vAuthor Commented:
Edited text of question.
srivatsa_vAuthor Commented:
Edited text of question.
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

1. Yes and no.
   you may have as much such process as the kernel allows, either up to max number of processes at all, or max number of processes per user.
2. the limit is either in the kernel and/or in the shell, see ulimit and/or limits command (deoending on your shell)
srivatsa_vAuthor Commented:
I am considering a hypothetical 32-bit system where there is no crunch for RAM and paging space (not really, but assume that these are not limiting factors)....

1. In theory atleast, on such a system, can we have as many processes as we want each of 4GB size? Assume the bulk of the kernel is pageable (process table etc. )

2. If there is some limitation on the number of such processes, what are the limiting factors (apart from performance issues) ...

srivatsa_vAuthor Commented:
Also pls assume that there are no per-user OR system-wide soft/hard limits ...
beside chris_calabrese's answer, the limit is as follows:

  the physical memory ($GB in your example) must contain:
    1. the code for paging, the code for task scheduling, and probably some other
    2. tables for paging
    3. tables for processes
    4. area to for the current task (one of the processes which is to be run in the time slice)

So if we asume 1. and 4. as a fixed size, 3. probably too as fixed size, then the number of processes depends on the size remaining for 2.

Is this the theoretical thing you're looking for?
I don't think any of these should present a limit to the number of processes with 4gb address space other than that they contribute to the total kernel memory used (all these things have to be in the kernel address space so the kernel can diddle with them - well, assuming it's not a microkernel that has a user-space process that handles the paging, but that doesn't change things all that much in the end).

They do, however, limit the amount of real memory a process might be able to use (i.e., it can't actually get all the real memory of the system because some of it's in use).

As far as the question of how much real memory might be used, the bare theoretical minimum is:
  1.  Code for paging.
  2.  Code for interrupt handling.
  3.  Interrupt vectors.
  4.  Pointer to kernel page table.
  5.  Pointer to page tables for tasks currently running (max of number of processors).
  6.  Code for handling switch from user space to kernel space.

The other things like the actual page tables and code for task switching can be paged in.  Yes, this is _really_ minimal and most real OS' keep a lot more kernel stuff nailed down in memory for performance reasons.  However, most modern hardware will let you do things this way if you wish.
.. I forgot the interrupt stuff, true.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.