Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2860

[PATCH] BreakingAlgorithm causes high memory consumption

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.3
    • 2.8
    • None
    • None

    Description

      when a single element (e.g. <fo:block>) contains a sufficiently large amount of text, the fo-to-pdf transformation causes very high memory consumption.

      For instance, transforming a document with <fo:block> containing 1.5 million characters (~1.5Mb test-1500000.fo) requires about 3Gb of RAM.

      The heapdump shows 27.5 million org.apache.fop.layoutmgr.BreakingAlgorithm.KnuthNode (~2.6Gb).

      We start observing this issue, having about 300 thousand characters in a single element (test-300000.fo). But the high memory consumption isn't observed when processing 250 thousand characters (test-250000.fo).

      Add <simple-line-breaking>true</simple-line-breaking> to fop.xconf for a lower memory method

      Attachments

        1. test-300000.fo
          296 kB
          Raman Katsora
        2. test-250000.fo
          247 kB
          Raman Katsora
        3. test-1500000.fo
          1.43 MB
          Raman Katsora
        4. memory6.patch
          1 kB
          Simon Steiner
        5. image-2019-04-16-10-07-53-502.png
          137 kB
          Raman Katsora
        6. fop.xconf
          0.1 kB
          Simon Steiner

        Activity

          People

            ssteiner Simon Steiner
            Raman_Katsora Raman Katsora
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: