Background GPS logger tasks stopping

When I run a GPS logger programs in the background they seem to stop running after a bit and I have to manually restart them.

Is there something that kills off backgrounds tasks it deems unwanted? And if so, how do I stop it?