java.lang.ref Caching

  • Robb Penoyer

    Robb Penoyer - 2003-06-25

    Have you ever considered implement a cache'ing mechanism for jdbm utilizing the java.lang.ref package?

    java.lang.ref provides reference/object classes which allow interaction with the garbage collector. So basically, you could let the garbage collector do the caching and serialization work for you...

    • Alex Boisvert

      Alex Boisvert - 2003-06-25

      Yes, this has been considered but not yet implemented.

      The provision for it is already there in the configuration options passed to the RecordManagerFactory.  See RecordManagerOptions.SOFT_REF_CACHE for instance.

      If you want to implement it, you would have to start by changing jdbm.recman.Provider which currently throws an IllegalArgumentException if SOFT_REF_CACHE is used.


    • Robb Penoyer

      Robb Penoyer - 2003-06-26

      Wow!  fast reply.

      I just might try it out this weekend. I have been looking for a good reason to try out java.lang.ref.



Log in to post a comment.