I'm writing an application that has a Foreground service that use GPS periodically to get the user location. The fore ground is working all the time and the application doesn't drain the battery because i don't use the GPS all the time. My problem is that after one hour while the application is in the background(more or less) Android kills my application while the foreground service is still running. It seems like it's because of memory usage but i'm checking my application and it doesn't consume a lot of memory, not more than application like facebook that stays open all night without getting closed.
any suggestion how to keep the application alive or maybe to find out why Android kills my application?
i also check and saw that the average usage if RAM memory is 25M . is that a lot? could this be the reason ?