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 7678531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:40:09+00:00 2026-05-31T17:40:09+00:00

My app is a background service running in the foreground. In low memory situations

  • 0

My app is a background service running in the foreground. In low memory situations some of my processing threads are being killed without the app being restarted. This is causing very strange behavior. I would like to be alerted by the OS when the memory is low before my process are killed. This will allow me to release memory or restart my app. I can’t seem to find a broadcast or notification for this situation.

  • 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-31T17:40:10+00:00Added an answer on May 31, 2026 at 5:40 pm
    1. There is one background service “DeviceStorageMonitorService” continuously running inside Android, which checks system storage directory periodically.
    2. This service maintains a memory threshold which is 10% of the assigned internal system memory, so in case of P2 it is 861MB, so memory threshold is 86 MB.
      We can change this by changing macro DEFAULT_THRESHOLD_PERCENTAGE inside file DeviceStorageMonitorService.java.
    3. It checks the size of available memory with the memory threshold, if it is less than threshold memory, it will broadcast notification and sticky broadcast intent ACTION_DEVICE_STORAGE_LOW.
      In case of full memory intent ACTION_DEVICE_STORAGE_FULL

    Receive this broadcasted intent in your receiver and handle the application.

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

Sidebar

Related Questions

I am implementing an app related to service, my service is running in background
I've got a location service running in background of my app with requestLocationUpdates(LocationManager.GPS_PROVIDER, 5*60*1000
I have written an app which can talk to server via background service to
I've got an Android app which has a periodic background Service. I want this
My app uses a BroadcastReceiver and a service to perform background updates. I have
Background: Our web app uses the jquery.constrain.js plugin to handle data entry in some
I have created a service running in background which saves gps points on the
I have some code that can spawn background worker threads from anywhere within it.
We've implemented a background service in our Asp.Net web app that receives messages from
Greetings, I have the following service running in the background: https://gist.github.com/807968 When I close

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.