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: "John Stiles" <email@hidden>
- Date: Wed, 24 Oct 2007 09:59:08 -0700
- Thread-topic: Troublesome app when scaling it up, how to proceed?
You know, it's really easy to write code to MD5 a file without shelling out to a separate process to do it. The algorithm is open-source and above that it's just fopen/fread/fclose (or various Cocoa classes if you prefer). That also opens the door to much, much cleaner error checking than dealing with error codes coming back from a command-line app.
-----Original Message-----
From: cocoa-dev-bounces+jstiles=email@hidden on behalf of Gerben Wierda
Sent: Wed 10/24/2007 7:55 AM
To: I. Savant
Cc: email@hidden
Subject: Re: Troublesome app when scaling it up, how to proceed?
>> 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
_______________________________________________
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