answersLogoWhite

0

Memory leaks do not occur in Java as the garbage collector clears the memory which has no references.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is java memory leak?

That means a memory leak in a program written in Java. A memory leak means that as the program runs, more and more memory is wasted - usually by being assigned and not de-assigned again. In Java this is not as usual as in other languages, since unused memory is normally reclaimed automatically by the garbage collector.


Can a Java application have memory leak?

Java has a fairly sophisticated garbage collection system, and in general you don't worry about memory leaks, as they only happen in a few very specific circumstances (notably, when adding listeners to Swing GUI objects and not removing them). If you need more sophistcated memory management, java provides the clases in the java.lang.ref package.


What is resource leak in java?

when a program consumes memory but is unable to release it back is known as resource leak solution for this is finally keyword by vidhya.t


What is caused when an application does not properly release memory allocated to it that it no longer needs and continually requests more memory than it needs?

memory leak


2 What is the purpose of garbage collection in java and when is it used?

Garbage collection prevents memory leaks. In Java, the Java Virtual Machine will garbage collect whenever there is memory that has no references.


How you allocate the memory in java?

In Java we need not allocate memory manually. The JVM would take care of allocating as much memory that your objects would require automatically.


In java a class will take memory?

Yes, executing a Java class will require memory just like any other program.


How programmer can access memmory in java?

You cannot. Java does not allow programmers access to the memory


How can you allocate memory dynamically in Java?

To give java more memory there are a series of steps to follow. To start, go to the computer's control panel, select programs, then go to java settings. This should initiate the Java control panel to pop up. Click on the Java tab followed by the view button. Click on the "runtime parameters" and input the specifics desired. Once finished hit okay then apply and it should increase the memory on your Java.


Who is allocated by java memory?

Objects, mainly.


How do you get memory information in Java program?

You can use the following to find out the memory usage information for a Java Program:Runtime.getRuntime().maxMemory()Runtime.getRuntime().totalMemory()Runtime.getRuntime().freeMemory()


Why does java provide garbage collection?

The idea of garbage collection is to reclaim unused memory - getting rid of objects that are no longer used. Since in Java, the programmer doesn't have to explicitly de-allocate memory that has been allocated, that not only reduces programming effort, this also eliminates a cause of lots of errors - since an error in this respect, by the programmer, would most likely cause a so-called "memory leak".