Add the ablity to run jstack for X time :

To run it:
jstackOverTime.sh PID FOR_HOW_LONG FREQUENCY  DIR

only PID is must