If you delete the file with something like "rm debug.log", the linux will not free up the space until after all processes that are running have been stopped.
So, you need to do something like "> debug.log" which will free up the space while the program is running.
Someone answered this in the past couple of pages with a cron entry that will do what you want without you having to manually do it.