Disk space being used up while running a script

We have a script which when run consumes the space of the disk from where it is being run. we have to kill this script every time to release space.

why do this happen ? any work around please

we are using solaris 10

P.S. : a part of the code will make some connection to the DB

If we would know what the script does, or even better you would post the code of the script using code tags, that would make it so much easier to try to answer your question. When doing so, remove/change passwords or any other confidential info in it.