Too many processes?

H

Herzl Regev

What happens in the RAM if I try to open too many processes? Is there a stage
that Windows will refuse to open more processes, or will it start to run
slowly? Will there be an error message? Particularly, "virtual memory too
low"?
 
A

Andrew McLaren

Herzl Regev said:
What happens in the RAM if I try to open too many processes? Is there a
stage
that Windows will refuse to open more processes, or will it start to run
slowly? Will there be an error message? Particularly, "virtual memory too

Hi Herzl,

Is this a hypothetical question? Or are you actually seeing a
capacity-related error message?

The number of processes, qua *processes*, that can be created by Windows XP
is limited only by the number of available process handles. I don't recall
off-hand the maximum number, but it is extremely large - maybe 64K or else
2^32.

However, the practical limit will not be the number of processes, as such;
but rather the resources which are consumed by those processes. If they are
GUI procs, they will allocate from the (finite) desktop heap, and hence, are
more limited than processes which run with no UI at all.

Also recall that the primary scheduling unit on Windows is not the process,
but the Thread. Windows is much more likely to hit exhaustion barriers
creating threads, than creating processes - in other words, 2 processes each
with 1,000 threads will bring Windows to its knees, long before (say) 500
processes, each running 2 or 3 threads each. By default, the Windows linker
assigns 1 MB of stack memory to each thread. If you have 2,000 threads, that
gives you 2GB of memory - the maximum which can be addressed in User Mode on
a 32-bit operating system.

As to the question of RAM ... this comes back to the old dichotomy between
REAL memory and VIRTUAL memory. Windows NT (including 2K, XP and Vista) is a
Virtual Memory operating system. On 32-bit Windows, every process has 4GB of
Virtual Memory, bifurcated between User Mode (2GB) and Kernel Mode (also
2GB - the kernel mode space is shared between all processes and threads). It
is the job of the Memory Manager to *map* those virtual addresses onto some
device - such as semiconductor memory (RAM), 4k-sized pages of disk space (a
page file), or some other, more exotic memory device. Processes or threads
themselves have little awareness of RAM; usually they only see virtual
memory addresses. Most PCs only have real memory (RAM) and paging files. If
the number of allocated virtual memory addresses exceeds the available pages
in the backing store, then you will see the "Virtual Memory too low"
message. If there is disk space available, one way to fix this is to
increase the size of the paging files. But if a process has allocated all
available virtual memory addresses (2GB, on a 32-bit system) it doesn't
matter how big your page files are - no more memory can be allocated.

Memory management can be a complex subject and not always amenable to brief
newsgroups answers. So I guess the main question is: is this a theoretical
question? Or are you seeing a capacity planning challenge which you need to
resolve?

For general background on Windows memory management, the best resource is
Chapter 7 of Solomon and Russinovich "Microsoft Windows Internals",
Microsoft Press 2004, ISBN 0-7356-1917-4.

Hope it helps,

Andrew
 
B

Bob Harris

XP will automatically increase the virtual memory, unless it hits a
limitation like insufficient disk space, or the maximum total memory
addressable by a 32-bit operating system.

But, since disk is much slower than RAM, using virtual memory will result in
a significant slowdown of the computer.

I have found this to be most obvious when working with large digital images.
When the size of the image equals about half of the RAM (really about 100
Meg less, since XP itself needs some RAM), then editting the image slows to
a crawl. And, there is a lot of disk activity. Given the low cost of RAM,
I have installed as much of the fastest RAM that my motherboard can handle.
In my case that was 2 Gig, as limited by my motherboard.

XP itself can use up to 4 Gig, with some cautions. See
http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx

Of course, the 64-bit version of XP can use a lot more RAM, but few people
have that version. And, even if they do, unless their motherboard supports
more RAM, it really does not matter.

Use the XP task manager to view RAM, virtual memory, and processes. You
also want to download and install two programs by Microsoft, "process
explorer" and "autoruns". The first is a better task manager. The second
can control what starts automatically.

If you are interested in which processes are necessary, check the Black
Viper website: http://www.blackviper.com/

Additionally, any processes related to your antivirus/anti-malware should be
left on.
 
P

Paul

Herzl said:
What happens in the RAM if I try to open too many processes? Is there a stage
that Windows will refuse to open more processes, or will it start to run
slowly? Will there be an error message? Particularly, "virtual memory too
low"?

There is a discussion here, on testing the limits of your OS :)

http://en.wikipedia.org/wiki/Fork_bomb

Make sure you know how to stop it.

Paul
 
H

Herzl Regev

The question was as theoretical as they come. The real question is, when is
the time to order more RAM for a slow system? This probably can't be answered
very well online. Alternatively, does the "Virtual memory too low" error
message have any connection to the size of RAM?
 
A

Andrew McLaren

Herzl Regev said:
The question was as theoretical as they come. The real question is, when
is
the time to order more RAM for a slow system? This probably can't be
answered
very well online. Alternatively, does the "Virtual memory too low" error
message have any connection to the size of RAM?

Just a quick answer (it's late, here!). Yeah there are a few guidelines you
can use to measure whether RAM and/or page file are becoming a performance
bottleneck. Just running Task manager and selecting the "Performance" tab is
a good start. On the local box (as opposed to the network), the three main
bottlenecks are CPU utilisation, memory use, and disk I/O. The Performance
tab will give you a quick feel for which of these 3 resources is the most
maxed out, at any moment and hence causing system slowdown. More detailed
measurement can be done, too. I'll try to put together a few suggestions pr
pointers, tomorrow or next day, if that's okay.

More soon,
Andrew
 
T

Twayne

Herzl said:
The question was as theoretical as they come. The real question is,
when is the time to order more RAM for a slow system? This probably
can't be answered very well online. Alternatively, does the "Virtual
memory too low" error message have any connection to the size of RAM?

The easiest way to tell if you need more RAM is to watch your pagefile.
If the pagefile is growing and getting smaller, growing, etc., you need
more RAM.

The easiest way to watch your pagefile size, though it can be done with
more difficulty using Task Manager, is with a page file monitor. When
the monitor just sits there on the screen like a slug, not chaning by
more than a few bytes at a time, you know you have enough RAM. It fhe
numbers change a lot, you need more RAM.

Pagefile monitors are availalbe all over the 'net for free. Grab one
from a reputable site, install it, and watch it for a few days; you'll
usually know within the first day whether you need more RAM or not as
you use your favorite applications and run multiple programs. Image and
video editors often are the worst programs to show you want more RAM.
Adding RAM when you don't need it won't make much difference to
anything. But adding RAM when the monitor shows you did need it, will
make those applications run faster and more efficiently. 1 Gig is often
enough for most people and 2 Gig is the normal point of diminishing
returns for having more RAM make much difference. Some highpower
workstatios will easily use 3 or 4 Gig, but those are running some
pretty intensive software that others seldom do.

Here's one good one from a good site:
http://www.softpedia.com/get/System/File-Management/XP-Page-File-Monitor.shtml

There are lots of others too with varying features.

HTH,

Twayne`
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top