WeakReferenced object is not garbage collected after calling System.gc()
I am a fresh new learner of Java. I'm now learning the concept of WeakReference. I came across a problem which probably looks stupid but I just wanna figure out the reason. The problem is: according to Java doc, "Weak reference objects, which do not prevent their referents from being made finalizable, finalized, and then reclaimed." So I did this small test: import java.lang.ref.WeakReference; public class A { public static void main(String[] args) { A a = new A(); WeakReference<A> wr = new WeakReference<>(a); a = null; A a1 = wr.get(); System.out.println(a); System.out.println(a1); try {