Class SoftReference<T>

java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.SoftReference<T>
one.pkg.tinyutils.reference.SoftReference<T>
Type Parameters:
T - the type of the referent
All Implemented Interfaces:
Supplier<T>

public class SoftReference<T> extends SoftReference<T> implements Supplier<T>
The class is necessary to debug memory allocations via soft references. All IDEA classes should use this SoftReference instead of original from java.lang.ref. Whenever we suspect soft memory allocation overhead this easily becomes a hard reference so we can see allocations and memory consumption in memory profiler.
  • Constructor Details

  • Method Details

    • dereference

      @Nullable public static <T> T dereference(@Nullable @Nullable Reference<T> ref)
    • deref

      @Nullable public static <T> T deref(@Nullable @Nullable Supplier<T> ref)