Well, it happens when no more memory is available for the application.
Typically that happens when your application creates an huge amount of objects or forgets to release resources and runs for a long time. The
documentation[
^] provides clues and examples.