Question: A Java application I support that runs on JRE 1.4.2\_12 is hanging near midnight every night. I'd like to try and record as much profiling information as I can to discover if there is an issue in the JVM or external to the app.

I'd like to use HPROF to collect as much information as possible.

1. Is there a way to have HPROF dump its cpu sample and memory allocation report every minute instead of at the termination of the JVM?
2. Is there a different, more appropriate profiler that can collect information like this?

Answer: 
First things first: did you analyze the thread dump when your application hangs? A lot of the time that has enough information to troubleshoot a hanging java app...

`Ctrl-Break` in the process window on Windows, or `kill -QUIT [pid]` on Linux.
I would first try to determine if its actually your app or something else. 

Are there any other apps on the box, if so do they run any batch around midnight. It could be a situation of your app suffering from a lack of resources due to other things running on the box or chewing up bandwidth. 

Was this always the case or did it start recently. If this is new look at what changed on the box as a whole not just your own app.