Yes, Java applications can run out of memory, like when images or image buffers are not getting garbage collected or when dispose() method is not used.
We all know Java automatically garbage collects unused objects. But you must remember that an object is considered as unused only when the object no longer referenced. That means a referenced class continues to exist and to take up memory space even if it is not used.
Login to rate this answer.
We all know Java automatically garbage collects unused objects. But you must remember that an object is considered as unused only when the object no longer referenced. That means a referenced class continues to exist and to take up memory space even if it is not used.
Login to rate this answer.
Anon
Answered On : Apr 12th, 2012
if you have an infinite loop that keeps on doing things that take up memory (like creating objects).

1 User has rated as useful.
Login to rate this answer.