Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1283

remove static caches from GenericData, SpecificData and ReflectData

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: java
    • Labels:
      None

      Description

      Currently GenericData, ReflectData and SpecificData are often treated as singletons, through an instance returned by a static get() method. Because of this, the caches they have must be thread-safe and are also memory leaks.

      Increasingly of late, new instances of these are allocated for use by a given DatumReader or DatumWriter. This issue explores whether we can:

      • Change the static get() methods to always return new instances, so that each DatumReader and DatumWriter has its own instance. Since DatumReader and DatumWriter are not thread-safe, the thread safety requirement could then be removed from caches, increasing their performance; and
      • Change caches to be non-static, to remove potential memory leaks.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cutting Doug Cutting
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: