Solved

Is there just one PID for an application and the services it loads

Posted on 2013-11-08
1
287 Views
Last Modified: 2013-11-16
Hi,

I have an android application that loads three services.  The application itself runs in the background with the three services.  I am wanting to do some CPU usage measures for the application and the three services.  I had placed the code that gathers the metrics that I am using in one of the services.  It occurred to me that the PID that I am getting me only be for the service.  I was hoping someone might know exactly how this works.  Does the application and the three services each have there own PID or is there one PID shared between the application and the services?  If I have not given enough information to answer this question, let me know and I will do what I can to supply more info.

Thanks
0
Comment
Question by:DLAtkinson
1 Comment
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 39635212
Not a specific answer to android, usually.
Each application at the time of running has a unique ProcessID. When it exits and after enough time has passed, the PID numbers are reused..
The PID is assigned by the system.
As to your question, a process starts and gets a process ID of 1234 it then starts three additional services/processes 2345, 2346, and 2347
The parent process ID (PPID) of each of these three will be 1234.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question