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

  • Home
  • SEARCH
  • 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 8311297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:45:56+00:00 2026-06-08T19:45:56+00:00

How is thread priority managed in Android? (Or what is the threading policy in

  • 0

How is thread priority managed in Android? (Or what is the threading policy in Android?) GUI threads would be assigned higher priority, right?

I’ve seen applications that create separate thread to clean up (native) resources since finalize() is discouraged. However, there is still memory leak (or memory inefficiency) since the cleanup thread is not running frequently enough.

Some other apps, those ignoring the advice on not to use finalize(), rely on the finalizer to clean up resources. So I’m wondering how is the finalizer thread scheduled? Is it a reliable way to release resources, either managed or native?

  • 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-06-08T19:46:00+00:00Added an answer on June 8, 2026 at 7:46 pm

    I would strongly recommend you to use AsyncTask for doing something in different thread. AsyncTask is very easy to use and I would say that it is one of the biggest advantages of java. I really miss it in obj-c.

    Async task got method

        onPostExecute(){}
    

    in which you can clean whatever you want after thread done it’s job.

    http://labs.makemachine.net/2010/05/android-asynctask-example/

    http://marakana.com/s/video_tutorial_android_application_development_asynctask_preferences_and_options_menu,257/index.html

    Links with tuts about AsyncTask.

    About priority: threads in android are threads in java, and they have priority from 0 to 10.
    You can set them for each thread as you would like.

    And about

    finalize();
    

    you should avoid using this method. As I already said u should better use AsyncTask class instead of Thread.

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

Sidebar

Related Questions

How to set program/thread priority (when talking about threads I mean ones that are
I'm trying to change priority of main thread using android.os.Process.setThreadPriority() . I have log
In the code below, I am trying to get the higher priority thread to
So that IO doesn't block the UI thread in my Android app, I'm trying
In Java, I know that the default thread priority is 5. I have a
We're currently changing the thread priority of a WCF RIA service call using this
Wrote a quick Java proggy to spawn 10 threads with each priority and calculate
Can Thread.Abort interrupt a thread that is sleeping (using, say, Thread.Sleep(TimeSpan.FromDays(40)) ? Or will
if (reader.is_lazy()) goto tldr; I have a background thread that does some I/O-intensive background
I am running a application with a LOT of thread. All these threads are

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.