Q: Delphi 5 application partially loaded in task manager, takes forever to actually display I have an application written in Delphi 5, which runs fine on most (windows) computers.
However, occasionally the program begins to load (you can see it in task manager, uses about 2.5-3 MB of memory), but then stalls for a number of minutes, sometimes hours.
If you leave it long enough, the formshow event will eventually occur and the application window will pop up, but it seems like some other application or windows setting is preventing it from initially using all the memory it needs to run (approx. 35-40 MB).
Also,  on some of my client's workstations, if they have MS Outlook running, they can close it and my application will pop up.  Does anyone know what is going on here, and/or how to fix it?

A: Since nobody has given a better answer I'll take a stab at how to solve this:
There's something in your initialization that is locking it up somehow.  Without seeing your code I do not know what it is so I'll only address how to go about finding it:
You need to log what you accomplish during startup.  If you have any kind of screen showing I find the window title useful for this but it sounds like you don't--that means you need to write the log to a file.  Let it get lost, kill the task and see where it got.
Note that this means you need to cleanly write your data despite an abnormal program termination.  How to go about this:
A)  Append, write your line, close.
B)  Write your line, then flush the file handle.
C)  Initially write your file to consist of a large number of blanks--ensure this is larger than the actual log will be.  Write your line.  In case of abnormal termination it will retain the original larger file size.
I would write a timestamp on every log item so you can see if it's just processing something too slowly.
If examining the log shows you where the problem is, fine.  If, as usually happens, it's not enough you put a bunch more logging between the last item that did get logged and the next one that didn't--I've been known to log every line when hunting a cryptic problem that only happened on someone else's system.
If finding the line isn't enough to pinpoint the problem also dump the value of relevant variables.
Finally, if such intense scrutiny makes the bug go away start looking for an uninitialized variable.  (While a memory stomp is also an option I doubt it's the culprit here.)
