My program runs and finishes and then after a few seconds this error message pops up. Any ideas as to the cause??
Stating the obvious, it means you have run out of memory! The default (initial) amount of memory available for your program, plus its heap and stack, is 2 megabytes so the simplest explanation is that you are trying to create one or more large arrays etc. which require more memory than that.
If that's the cause, simply increase the amount of memory available to your program by raising HIMEM at the very start of your code. So for example if your program requires about 8 megabytes add this statement:
HIMEM = PAGE + 8000000
Another possibility is that you have a fault in your program's structure which is resulting in a 'memory leak', i.e. an ever-increasing use of memory as the program runs. A classic cause of such a memory leak would be attempting to jump out of a loop (e.g. a FOR...NEXT loop) using GOTO rather than EXIT.
To get more specific advice you would have to list a short program which demonstrates the issue.