title: Loitering objects Garbage Collection in Java
body: <p>I was reading Garbage Collection in Java  and i came across Loitering Objects.</p>
  
  <p>These objects are allocated memory, but not used, and not garbage collected. These keep increasing the size of the JVM heap and represent memory leaks,  which can cause an out-of-memory error or excessive overhead on the garbage collector. </p>
  
  <p>Can anyone please provide a code example for these Loitering Objects.</p>