Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6998391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:24:21+00:00 2026-05-27T20:24:21+00:00

I have a service that reads real-time sensor data. The data is read in

  • 0

I have a service that reads real-time sensor data. The data is read in sequence, 4 different types each about 50 ms apart. Actually the sensor data comes via bluetooth but is read out of the inputStream by the service.

Now it is crucial that the data is timestamped at its arrival with the most precision possible and thats where i have a problem with the gc. Should the gc kick in between reading data and timestamping it, even 20 ms lead to ugly results. Also it is crucial that the data never has larger gaps as i already have 200 ms between the same data types.

On the other hand i want the data to be transfered in real-time to an app (mini delay is ok).
I managed to write the service so that it allocates all its objects in the beginning and never ever produces any trash for the GC. But for IPC i need to create parcelable objects to send them to the app.

Question 1: if i create such objects and send them via IPC to the app, on whos memory do they exist ? As 2 processes dont share memory.

Question 2: does it cost me performance to use IPC ? because i could simply make the service run in the same process and share the data 10 times more easily.

The app will have GC, so if the service runs in the same process there is the danger of the GC disrupting the real-time data handling. However if i divide them into 2 processes im afraid that the IPC costs me some performance that may outweigh the GC trouble.

The service only works for one single app, but should run as uninterrupted as possible AND deliver its data as real-time as possible. So put it in its own process or not ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:24:22+00:00Added an answer on May 27, 2026 at 8:24 pm

    Now it is crucial that the data is timestamped at its arrival with the most precision possible and thats where i have a problem with the gc.

    Please use a RTOS for that degree of precision. Android is not an RTOS.

    Question 1: if i create such objects and send them via IPC to the app, on whos memory do they exist ?

    In both processes. Which is why you should get rid of the second process, as you do not need it.

    Question 2: does it cost me performance to use IPC ?

    Absolutely. IPC is expensive.

    because i could simply make the service run in the same process and share the data 10 times more easily.

    Please do.

    The app will have GC, so if the service runs in the same process there is the danger of the GC disrupting the real-time data handling.

    Any GC in any process could “disrupt the real-time data handling”. Any work in any process could “disrupt the real-time data handling”. The vast majority of Android devices in use today are single-core, and that one core can only do one thing at a time. Even for multi-core devices, you are not in control over the process and thread scheduling with respect to the cores, because that is managed exclusively by the firmware.

    Again, your project seems like it calls for an RTOS, and Android is not an RTOS.

    So put it in its own process or not ?

    You should use a suitable RTOS and not Android.

    If, for whatever reason, you elect to stick with Android, do not put it in its own process, as it will not help you and only wastes RAM and CPU time. But your delays will routinely exceed the 20ms level you deem as “ugly”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page with a datatable that reads data from a service class.
We have a service that runs methods used for data import/export at specified intervals.
I have a mail reading service that reads every email from an inbox, parses
We have a service that has some settings that are supported only over net.tcp.
I have a service that sometimes calls a batch file. The batch file takes
I have a service that I am rewriting to use threading. I understand that
I have a service that accepts callbacks from a provider. Motivation : I do
I have a service that I would like it to become single instance, because
I have a service that is downloading a file. When the download is done,
I have .Net service that listens on single port over TCP protocol. Clients connect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.