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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:42:11+00:00 2026-05-22T12:42:11+00:00

After instantiating a Thread and start it what will happened to the created instance

  • 0

After instantiating a Thread and start it what will happened to the created instance of it. Will it have same behavior as other instance?

Thread a = new MyThread();
a.start();

a = null

where this created instance of Thread resides(in heap or doesn’t it be in tenured space). will it be garbage collected?. If it is get garbage collected what happened to used instance properties?

  • 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-22T12:42:11+00:00Added an answer on May 22, 2026 at 12:42 pm

    A thread will not be garbage collected while it is “live”, irrespective of whether the Thread object can be accessed. This is a consequence of the JLS’s definition of reachability.

    For the record, a typical JVM allocates a thread’s stack in memory that is outside of the heap(s). The Thread object and its children are regular heap objects. These may be garbage collected: the specifications are silent on this, AFAIK. Finally, part of a thread’s state may reside in memory managed by the OS kernel.


    when I view the JVM through the JProfiler I was unable to find the instance of the MyThread which I create.

    1. That doesn’t prove that it has been garbage collected. All it proves is that JProfiler couldn’t find it.

    2. If the thread has terminated (and you haven’t kept a reference to the Thread object) then it / they will no longer be reachable, and JProfile won’t be able to find it.

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

Sidebar

Related Questions

I have created an object through literals and instantiating using 'new' operator. But that's
I'm working on a module that requires a strictly decoupled interface. Specifically, after instantiating
After reading the Head First Design Patterns book and using a number of other
After lots of attempts and search I have never found a satisfactory way to
After reading a bit more about how Gnutella and other P2P networks function, I
An Unstarted thread is transitioned into the Running state by calling Start. [from msdn
After instantiating a list (so ignoring the overhead associated with creating a list), what
Is it possible to send data to a starling object after instantiating it? var
Do Java ThreadLocal variables produce thread-local values if they are used as instance variables
I have the following Mongoose schema that embeds another: var EmbedSchema = new Schema({

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.