HELP -- fork: "not enough space"

HELP -- fork: "not enough space"

Post by Peter J. Schwalle » Fri, 21 Jun 1996 04:00:00



I have an application which forks children.  These children in
turn fork other children.  As work progresses, the older parents
finish and exit().  At some point in my application, either
after forking many children serially or in parallel, I get a bad
return code from the fork() call.

The errno is ENOSPC which maps to a "not enough space" message.

What is causing this?
How can I avoid it?

Thanks in advance,
Peter J. Schwaller
Ganymede Software

--
Peter J. Schwaller
Ganymede Software Inc.

 
 
 

HELP -- fork: "not enough space"

Post by Bryan O'Sulliv » Fri, 21 Jun 1996 04:00:00



p> I have an application which forks children.  These children in turn
p> fork other children.  As work progresses, the older parents finish
p> and exit().  At some point in my application, either after forking
p> many children serially or in parallel, I get a bad return code from
p> the fork() call.

p> The errno is ENOSPC which maps to a "not enough space" message.

p> What is causing this?
p> How can I avoid it?

You have too many processes running at once, and the system has run
out of virtual memory.  You have a number of options: run fewer
processes at once, reduce their memory consumption, or add more RAM
and swap space to your system.

        <b

--
Let us pray:
What a Great System.
Please Do Not Crash.


 
 
 

HELP -- fork: "not enough space"

Post by Charlie W » Sun, 30 Jun 1996 04:00:00


I think you are running out of memory? Try quit other memory-consuming
applications and run your program again.

Charlie


> I have an application which forks children.  These children in
> turn fork other children.  As work progresses, the older parents
> finish and exit().  At some point in my application, either
> after forking many children serially or in parallel, I get a bad
> return code from the fork() call.

> The errno is ENOSPC which maps to a "not enough space" message.

> What is causing this?
> How can I avoid it?

> Thanks in advance,
> Peter J. Schwaller
> Ganymede Software

> --
> Peter J. Schwaller
> Ganymede Software Inc.


 
 
 

HELP -- fork: "not enough space"

Post by Piers Bowne » Fri, 05 Jul 1996 04:00:00


An alternative, although a fairly substantial change would be
to look at switching to a Light Weight Process (lpw_create())...



Quote:

>If you have a parent that forks more than one child and each
>child forks more than one child ad nauseum, then ENOSPC is being
>caused by running out of virtual memory (physical + swap).  You
>can check for ENOSPC and sleep a second or two and re-try or come
>up with a way to reduce the number of children that you create or
>get more memory/swap space or all of the above.

>I hope this helps.  good luck.

 
 
 

1. Solaris 2.7: "fork: not enough space"

I've currently got 680 webs (not including ServerAliases) running off of
Apache 1.3.12 on an UltraSparc 360 with 256MB memory, 2048MB Swap, which is
running Solaris 2.7

Right now, I have to have "MaxClients" set to 150.  If I bring the number up
to 500 (or even 200), where I'd like to have it, The system goes out of
control slow, and I have a very hard time even gaining shell access.  When I
do get into the machine, almost everything I try (ps, df, top, etc) yeilds
an error similar to: "fork: not enough space".

as soon as I kill apache the issue resolves.  If I start apache, the problem
comes back after just a few minutes.

I understand that this is not specifically an Apache problem, and it just so
happens that Apache is what is taking most of the resources, but more of an
Operating System problem... but I'm still looking for help.

My best guess is that the system is not allocating the right amount of
memory to internal processes, but I dont even know how to tell.

using top, I see right now, that the CPU  95.2% idle,  0.4% user,  1.4%
kernel,  3.0% iowait,  0.0% swap
I see the memory: Memory: 256M real, 3808K free, 1036M swap in use, 1136M
swap free

server being the servername,  This is what I configured with:
./configure \
--prefix=/home/server/www \
--enable-module=cern_meta \
--enable-module=info \
--enable-module=status \
--enable-module=expires \
--enable-module=mime_magic \
--enable-suexec \
--suexec-caller=webguy \
--suexec-userdir=cgi-bin \
--suexec-docroot=/home/server \
--suexec-uidmin=100 \
--suexec-gidmin=10 \
--suexec-safepath="/usr/local/bin:/usr/ucb:/bin"

Here is an example of what each of the 680 webs has in the config file:
<VirtualHost 1.2.3.4>
ServerName www.domain.com
ServerAlias domain.com
DocumentRoot /home/server/www2/www.domain.com/web
User username
Group groupname
CustomLog logs/virtual/www.domain.com/www.domain.com.20020108.log combined
ScriptAlias /_vti_bin/_vti_adm/
/home/server/www2/www.domain.com/web/_vti_bin/_vti_adm/
ScriptAlias /_vti_bin/_vti_aut/
/home/server/www2/www.domain.com/web/_vti_bin/_vti_aut/
ScriptAlias /_vti_bin/ /home/server/www2/www.domain.com/web/_vti_bin/
ScriptAlias /cgi-bin/ /home/server/www2/www.domain.com/web/cgi-bin/
</VirtualHost>

- please carbon copy replies to jkister at netreach.net

Thanks!!

Jeremy

2. gcc help

3. ??: "xpm: Not enough colors." In "xpat2" Card Game???

4. how to install 2 kernal in redhat 6.2?

5. ??: "xpm: Not enough colors" In "xpat2" Card Game?

6. Unix - Frequently Asked Questions (Contents) [Frequent posting]

7. SCSI on Sol8 - read: "not enough space"

8. Where is the Solaris 7/x86 boot manager ?

9. "ld: fatal: file /dev/zero: cannot mmap file: Not enough space"... but why ?

10. mksysb restore "not enough disk space selected"

11. "not enough drive space" error.

12. vi "not enough space" error

13. tape recover error "not enough space"