1 Object someMethod() 2 { 3 Object o = new MemoryIntensiveObject(); 4 SoftReference<MemoryIntensiveObject> ref = new SoftReference<MemoryIntensiveObject>(o); 5 //Assume garbage collector at this point and needed to free up memory. 6 return ref.get(); 7 }