Re: Troublesome app when scaling it up, how to proceed?
Re: Troublesome app when scaling it up, how to proceed?
- Subject: Re: Troublesome app when scaling it up, how to proceed?
- From: "Gerben Wierda" <email@hidden>
- Date: Wed, 24 Oct 2007 16:55:07 +0200 (CEST)
- Importance: Normal
>> Anyway, I was wondering what the best tools are to track this kind of
>> a problem down. I have been looking at a few, but haven't seen an
>> obvious one to help me find out what is happening.
>
> How about using the debugger? You should be able to determine
> exactly where the problem begins (or at the very least get a more
> specific idea). Have you tried this? I ask because you haven't
> mentioned whether you've tried that or anything else.
>
> You should at least be able to figure out what task is causing the
> problem ...
I did try the debugger but that does not help me at all in this case.
Something outside my app dies (e.g. running a couple of subprocesses in a
pipe as in getting an md5 hash value for a file) and this is never picked
up by my app. The app lives. It just does not pick up that something died.
But my guess for a resource problem was right. I used setrlimit() to
increase the number of max open files (from the 4096 I had set it to in
the past) to 10240 and now it works again.
So, my problem is 'solved' though I am pretty unhappy about this 'solution'.
When my app and subprocesses run out of system resources, I am unable
(either in the debugger or in any other way) to catch that problem.
Somehow, it seems, maybe due to my apps architecture, these resources are
not properly freed until I my subprocesses for a certain task have run (I
know this because if succesful, I can run the same thing over and over
again without running into the same problem, so it is not a leak, but a
temporary shortage. Intuitively I think it is connected to delayed freeing
of resources in the system for some reason). I run a set of processes (as
in the pipe above), e.g. via NSTasks which are coupled with NSPipes (or
more complex with a wrapper object around NSAuthWithPrivileges() if they
have to run with privileges, somehow some subprocess runs into a resource
shortage, dies, but this is not signalled to my app (which is programmed
to pick up these signals and react to it) which is left in limbo. As far
as my app is concerned, it is still waiting for the died subprocess.
I think my app with its complex design with threads, DO to talk between
threads, threads to write to and read from named pipes to work around the
limitations of AuthExecuteWithPrivileges(), is at the end of its useful
life.
I am going to have a look at 10.5 to see if this might give me frameworks
and tools to do a proper redsign. One never knows.
Thanks for the feedback.
G
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden