0

I have a service in Android which takes a lot of memory and is occasionally removed from running. What is the rule by which Android decides to remove a process? If so - how can I tell I'm about to stop running due to too much memory consumption? Most of the memory I allocate is allocated in native code.

4

1 回答 1

0

如果其他一些应用程序正在消耗内存,那么服务也可以终止。因为没有足够的堆内存来为您的应用程序分配。要处理这个问题,您可以处理低内存功能并通知用户应用程序正在低内存上运行。另外,同时启动您的服务,您可以设置重新启动。

干杯。

于 2013-02-03T13:59:06.153 回答