Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-441

remove CosName nameMap cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.7.3
    • 1.2.0
    • None
    • None

    Description

      The CosName class keeps a cache of all instances created in a static synchronized map. I am guessing this is for performance reasons to avoid creating objects, but in our system it is causing performance problems. We are running 7 threads extracting text from pdf's, and we can see a large number of conflicts reading from nameMap.

      The CosName map is also a potential memory leak, which forces users to periodically clear it, as noted in PDFBOX-351

      Can nameMap be removed altogether?

      At the least, if PDSimpleFont replaced,

      COSName.getPDFName( "FontDescriptor" )

      with

      COSName.FONT_DESC

      It would reduce contention.

      Attachments

        1. COSName.java
          24 kB
          Frank Nestel

        Activity

          People

            Unassigned Unassigned
            sgbridges Sean Bridges
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: