Object Expiration

JVM removes the preferences if

  1. Reference is used in a function and the function finished executing
  2. Reference is overwritten by another reference
myReference = new Reference();
  1. Reference is set to null
myReference = null;