How to calculate the memory used by several processes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let's say you've got a process like inetd that forks off several copies
of the same program, each of which forks several copies of some other
program, as follows:

Inted -> Program X -> Program Y
			 -> Program Y
	-> Program X -> Program Y
			 -> Program Y
	-> Program X -> Program Y
	-> Program X -> Program Y

So at any one time the system process table will show four instances of
Program X and eight instances of Program Y. Let's say this is on a
Redhat AS 2.1 system running kernel 2.4.9-e.3.

What's the total system RAM consumed by these programs? Is it simply the
sum of the amount of RAM required by Program X and Program Y multiplied
by four and eight respectively? Or is there something more complicated
in the way the Linux kernel manages memory?

The practical reason for the question is to determine the maximum number
of Program X that we can allow (based on the amount of free system RAM)
in order to prevent the system from swapping to disk when too many
Program Xs are running.

Regards,
 
Michael Martinez
ISTM/CSREES
United States Department of Agriculture
---	
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux