-1

I'm developing the app, which is supposed to be active all the time on the device (customer-specific app). The application isn't big, it doesn't use a lot of resources, but it works with scheduling (handlers, timers, AlarmService).

And it happens, that customer reports the device reboots by itself from time to time (once in a day or more rarely). I don't know the reason. Unfortunately, I don't have any logs related to shutting down of the devices.

In "onCreate" method, I start logcat process and write all logs into a file, but there are nothing useful. Yes, I know, it's hard to find a reason without them. I'm trying to capture as much information as i can.

There are also 2 services, that runs every ±1hour, one pull the data from the git (JGit lib) and another sends some messages to the server. We also have logging for developers (write to a file), and we use only one instance of FileWriter (so we don't close it). Could you suggest, what CAN possibly be the cause of rebooting? What is common mistakes in such apps? How can I find the reason of rebooting.

Yes, I know, I didn't provide enough information, but any advices would be really helpful for me.

1615903
  • 32,635
  • 12
  • 70
  • 99
Roman Diachuk
  • 31
  • 1
  • 4
  • What version of Android? Is there a common time of day or series of actions before the crash? Does it happen everywhere the device is (don't laugh, since Android 8.0 my Pixel XL resets if I use it in my bathroom. I suspect something weird with the cellular radio signal in there). – Gabe Sechan Nov 03 '17 at 18:23
  • Version 5 and 5.1. I can't find more common circumstances for the crashes – Roman Diachuk Nov 04 '17 at 15:31

2 Answers2

0

Since your application using File and FileWriter which you are not closing. Please check the number of File Descriptor[FD] count. If FD count reached to 1024, System automatically restarts the APP to reset the count.

  • It does? This would seem very unlikely. An attempt to create additional file descriptors would fail, but it wouldn't restart the app. And even if it did, he said the device is rebooting. – Gabe Sechan Nov 03 '17 at 18:21
0

Sometimes Android just seems to restart when there is a lot of allocated memory, which not only has to do with the app but maybe with the whole system and environment. Try to delete all the cache from your storage and save free space, this may improve the R/W speed from disk.