answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

Yes, there could be memory leak in Java applications.

Memory leaks occur when the application doesn't free the memory allocated,

usually are the objects no longer in use, but the object references are lost.

This kind of objects will not be collected by the garbage collector.

That means there is a memory leak.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can a Java application have memory leak?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is memory leak problemin java?

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


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


How to improve memory issues and performance of java application?

What are the memory issues you are having? Where is the performance problem? Describe your problem!


What does java security do?

Defines the security policy for each application .Every Java Application can have its own Security manager.


What is the Java Garbage Collector?

A Garbage Collector in Java is a Java program that runs automatically every few seconds to check if there are any objects in the JVM memory that is not being used/referenced by the programs that are being executed. If so, such objects would be removed from the memory, making the free memory available for the other objects to use. This is very good for us because, we need not write specific programs to release unused objects to ensure that our application has enough memory to keep running. If the garbage collector is not there, then we would have manually write the code to ensure that our app keeps running. If we don't have the garbage collector, then we would be very frequently getting Out of Memory error in our application.

Related questions

What is memory leak problemin java?

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


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.


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


How to improve memory issues and performance of java application?

What are the memory issues you are having? Where is the performance problem? Describe your problem!


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


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


What is a heap dump?

A heap dump is a snapshot of the memory heap of a running Java application, captured at a specific point in time. It provides detailed information about the various objects and their sizes in memory, helping developers analyze memory usage, detect memory leaks, and optimize application performance.


What is an important difference between writing a Java application and a Java applet?

A Java applet is embedded within a web page, while a Java application will run directly on your computer.


What does java security do?

Defines the security policy for each application .Every Java Application can have its own Security manager.


What is the areas of application of java?

Applications that are built using the Java language are termed as Java applications.


How do you execute a Java program?

You can run a Java application from the command line using "java <name of the class>"


What is the Java Garbage Collector?

A Garbage Collector in Java is a Java program that runs automatically every few seconds to check if there are any objects in the JVM memory that is not being used/referenced by the programs that are being executed. If so, such objects would be removed from the memory, making the free memory available for the other objects to use. This is very good for us because, we need not write specific programs to release unused objects to ensure that our application has enough memory to keep running. If the garbage collector is not there, then we would have manually write the code to ensure that our app keeps running. If we don't have the garbage collector, then we would be very frequently getting Out of Memory error in our application.