• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Weirdness in my PowerBook... Now reproducible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weirdness in my PowerBook... Now reproducible


  • Subject: Re: Weirdness in my PowerBook... Now reproducible
  • From: Will Mason <email@hidden>
  • Date: Sun, 2 Apr 2006 15:01:10 -0700 (PDT)

You can get the number of processes that the current user can execute with getrlimit(2). You don't need to launch another process to find that out.

 Will

----- Original Message ----
From: Jerry Krinock <email@hidden>
To: Cocoa Developers <email@hidden>
Sent: Sunday, April 2, 2006 4:06:38 PM
Subject: Re: Weirdness in my PowerBook... Now reproducible

on 06/04/02 09:47, Jordan Krushen at email@hidden wrote:

> My guess would be that you're hitting the per-user limit.  See ulimit
> -a.  If you can switch to another user and still run stuff, then
> you're hitting your user limit (100 procs by default), not the system
> one.

That is correct, ulimit -u shows me that "max user processes" is 100.

So, I started opening Terminal windows (This is after quitting apps so that
my app would run.)  After opening about 15 Terminal windows, after "Welcome
to Darwin!", it says:

-bash: fork: Resource temporarily unavailable

This occurs when I have 82 processes running with UID=501 (me).

Similarly, my app starts hanging on NSTask -waitUntilExit when I have more
than about 65 processes running with UID=501.  Sometimes the uuidgen()
NSTask hangs too.  Reduce the number of open Terminal windows and my app
launches with no problem.

Logically, the difference (82-65) should be the number of processes spawned
by my app, but that seems too high since my app spawns no more than 3
NSTasks and always with -waitUntilExit, so no more than one at a time is
running.  So, the system seems to require more "margin" before it allows my
app to spawn an NSTask than it does a bash shell in Terminal.

Does anyone know how to increase the ulimit?  After some Google-research, I
tried to increase it to 120 from 100 but it didn't seem to work:
Jerrys-Powerbook:~ jk$ ulimit -u
100
Jerrys-Powerbook:~ jk$ ulimit -u 120
Jerrys-Powerbook:~ jk$ ulimit -u
100

Maybe an emprical "solution" to the "problem" is something like this:  When
app launches, see how many user (501) processes are running, and if this is
more than "ulimit -u" minus 20(?), tell user that system does not have
enough resources to launch my app.  But oops, I need a way to get all this
info without using NSTask.

If no one here can explain this mess, I'll go find some Unix geeks to
consult with.  But not for a few days because, now that I can reproduce it,
I have some other more pressing issues needing attention.  I'll let y'all
know whenever I get some understanding of this.

Jerry


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Weirdness in my PowerBook... Now reproducible
      • From: Markus Hitter <email@hidden>
  • Prev by Date: Re: Reading values from XML file
  • Next by Date: Re: Extracting file name & path from NSOpenPanel
  • Previous by thread: Re: Cocoa-dev Digest, Vol 3, Issue 420
  • Next by thread: Re: Weirdness in my PowerBook... Now reproducible
  • Index(es):
    • Date
    • Thread