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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:58:03+00:00 2026-05-13T10:58:03+00:00

I heard most elegant property of java is Garbage Collection I wanna know does

  • 0

I heard most elegant property of java is Garbage Collection
I wanna know does it guarantee that a program will not run out of memory?

  • 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-13T10:58:04+00:00Added an answer on May 13, 2026 at 10:58 am

    No it does not guarantee this. It is perfectly possible for a programmer to mistakingly create objects which never go out of scope, thus consuming more and more memory until all heap is exhausted.

    It is the programmer’s responsibility to ensure that objects no longer in use are no longer referenced by the application. That way the garbage collector can do its job and reclaim memory used by these objects.

    Example

    public class Main {
      public static void main(String[] main) {
        List<String> l = new LinkedList<String>();
    
        // Enter infinite loop which will add a String to
        // the list: l on each iteration.
        do {
          l.add(new String("Hello, World"));
        } while(true);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've heard that most lisps support saving image of running program into file. Does
I heard that JNBridge will translate C# code to native Java code.( I haven't
I believe that most of you have heard of preloading of images. But is
I know and heard most UI related shouldn't be done in thread other than
I have heard several podcasters (most recently the guys on DotNetRocks ) say that
Provably most of you know AdDuplex to cross-promote WP7 apps and games. That ad
Most people have heard of Content Management Systems. However, what basic features should an
Now I've heard the expression maths is the language if the universe; and most
I heard that List<T>.AddRange(IEnumerable<T>) faster than new List<T>(IEnumerable<T>) . After looking in reflector I
I heard from a relatively trustworty source that gettext doesn't require system locales for

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.