A resource error occurs when some resource runs out. For example, you can run out of virtual memory, or you can exceed the operating system limit on the number of simultaneously open files.
Often a resource error arises because of a programming mistake: for example, you may exceed the maximum number of open files because your program doesn't close files when it has finished with them. Or, you may run out of virtual memory because you have a non-terminating recursion in your program.
The exception code for a resource error is
resource_error(Goal, Resource, Message)
0if no goal was responsible; for example there is no particular goal to blame if you run out of virtual memory.
Some Resources recognized by the system include:
0-- No resource specified
memory-- out of memory
'too many open files'