6

What is empty process in android and what is it’s use. I have seen empty process in my device sometime and it shows process with 0 services ,0 activities means process with no components inside it . I also want to know if as a developer,it's of any use or it's just useful on OS level.

amarnathpatel
  • 981
  • 10
  • 20

2 Answers2

13

What is empty process in android

It is a process with no running activities, services, or broadcast receivers (and where nothing presently is connected to one of the app's content providers, if any, though this is a fairly obscure case).

what is it’s use

Once upon a time, the process did have activities, services, and/or broadcast receivers. However, those components were destroyed as a part of their normal operation (e.g., a manifest-registered receiver returned from onReceive()). Right now, the process is being held onto, just in case that a process for the same app is needed again. Eventually, though, the empty process will be terminated, to free up system RAM for other processes.

I also want to know if as a developer,it's of any use or it's just useful on OS level.

Mostly, it is an OS-level optimization to improve device performance and responsiveness, compared with terminating the process immediately when the last running component was destroyed.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    @CommonsWare does that mean, empty process is a state of a process where the process has completed the task it is supposed to do, and waiting for OS to terminate it? – Vinod Akkepalli Oct 23 '15 at 13:57
  • @VinodAkkepalli: Yes, that is a reasonable description. – CommonsWare Oct 23 '15 at 13:58
  • So. when i close down an app on my phone using recent apps button( lets say) an empty process is created...? – c_mnon Aug 08 '16 at 16:51
  • 1
    @c_mnon: I do not know what "close down an app" means. If you are using the overview screen (recent tasks list) to switch to a new task, whatever activity was in the foreground simply moves to the background. There is no immediate impact on the process. Android 5.0+ devices allow you to swipe an entry off the overview screen; this should terminate your process, at least if you have no services running. A process becomes empty if the user uses BACK to navigate out of all running activities within that process, or those activities are `finish()`-ed by other means. – CommonsWare Aug 08 '16 at 16:54
  • @CommonsWare Thanks.You understood my query very well considering lack of clarity in my question...!!! Let me just retell the thing to make sure I understand correct. So if i use BACK to navigate out of the running activities that process becomes empty, but still will be using up RAM. but if I use the swipe off overview screen, I terminate the process(5.0+) and all the RAM is freed up. ( I want to make sure I have maximum free RAM available - kind of thing !!) – c_mnon Aug 08 '16 at 17:02
2

What is Empty process?

Process that doesn't hold any active application components.

What is it use?

The only reason to keep this kind of process alive is for caching purposes, to improve startup time the next time a component needs to run in it.

The system often kills these processes in order to balance overall system resources between process caches and the underlying kernel caches.

Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70