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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:03:55+00:00 2026-05-11T00:03:55+00:00

If I have two objects on the heap referring to each other but they

  • 0

If I have two objects on the heap referring to each other but they are not linking to any reference variable then are those objects eligible for garbage collection?

  • 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. 2026-05-11T00:03:55+00:00Added an answer on May 11, 2026 at 12:03 am

    Yes, they are. Basically the GC walks from ‘known roots’ (static variables, local variables from all stack frames in alll threads) to find objects which can’t be garbage collected. If there’s no way of getting to an object from a root, it’s eligible for collection.

    EDIT: Tom pointed this out, which I thought was worth lifting into the answer itself:

    Technically, static variables are not roots – they are referenced by classes which are referenced by class loaders which are referenced by classes which are referenced by object which are referenced by root references.

    The difference is likely to be irrelevant most of the time, but it’s good to know 🙂

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

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Streaming the images through an ASPX page is a good… May 11, 2026 at 11:30 am
  • added an answer Don't start by thinking big. Start by thinking small. When… May 11, 2026 at 11:30 am
  • added an answer Such tools exist. They are the subject of a discipline… May 11, 2026 at 11:30 am

Related Questions

If I have two objects on the heap referring to each other but they
If I have two objects, one being the list of items, and the other
If I have two variables: Object obj; String methodName = getName; Without knowing the
If I have two dates (ex. '8/18/2008' and '9/26/2008' ), what is the best
If I have two tables... Category and Pet. Is there a way in LINQ
If I have two variables containing binary values, how do I append them together
If I have two UIColors, what's the best way to draw an even gradient
This is on the Mac: If I have two filenames /foo/foo and /foo/FOO they
This might be a bit of a silly question but; If I have two
I have two dates (parsed using str2time ). How can I tell if one

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.