I’m trying to benchmark execution time for a program I created. As I add more data for it to process it takes longer and I am trying to find out how long exactly and a few details about the program(number of loops, time for each loop,etc..) so I created a system.out.println… of the status messages I want. This program works with a small number of variables quickly, but to run it on a large amount I do: java my_program > results.txt &
I see the job running for about 2 hours than it vanishes, so assuming its finished I try to cat results.txt but its blank. If java was crashing, wouldn’t the error message be in there also(I think I’m capturing all output)? If not, is there a place I can find this information?
You redirected stdout to a file, but any errors would have been written to strderr, which was not redirected. See http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html for an example of how to redirect both stdout and stderr