The number of applications running is almost irrelevant to whether programs crash or not - that will only happen in your memory usage is very extreme (eg: 5 times your physical memory). In general the only thing it would affect is the speed.

The crash is almost certainly an issue with your code. Even if it isn't, your code should still deal with it in a graceful way rather than crashing.