Wraps Java's SoftReference class, falls back to Ruby's WeakRef if SoftReference is unavailable.