Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-891

Use DirectMemory as Level 2/Offheap cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8
    • 0.16
    • core
    • None

    Description

      To make optimum use of memory allocated to the various caches created in Oak it would be better to use Apache DirectMemory [1] as the level 2 (L2) cache. Further using Kryo[2] Serializer would enable saving of serialized objects in more compact form

      • Storing cache objects in serialized form provides a more compact storage
      • Deserializtion cost is low
      • Using Off heap memory would be helpful compared to on heap memory
      • L2 cache can be added as an optional feature. Oak Core can still be
        used in absence of L2 cache

      Implementation details

      Implementation notes

      • Adds DirectMemory and Kryo library as optional dependencies
      • Decorates the Guava Cache to move the evicted objects to L2 cache
      • Using L2 cache is completely optional
      • Kryo library is used to provide fast and compact serialization.
      • Uses custom serializers for various cache instances to provide a more compact storage
      • Instead of using the key as is (i.e. path in MongoMK) it stores the hash of the path to conserve memory

      Initial discussion at http://markmail.org/thread/xief4l25m7tnx52c

      [1] http://directmemory.apache.org/
      [2] https://code.google.com/p/kryo/

      Attachments

        1. OAK-891-2.patch
          59 kB
          Chetan Mehrotra
        2. OAK-891-1.patch
          32 kB
          Chetan Mehrotra

        Activity

          People

            chetanm Chetan Mehrotra
            chetanm Chetan Mehrotra
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: