ICEpdf
  1. ICEpdf
  2. PDF-627

Core library is spending quite a bit of time garbage collecting

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.2
    • Fix Version/s: 5.0.3
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      A few users have point at this but I thin I finally found the cause. When working though a large document there is an eventual slow down and there is a lot of time spent doing garbage collection. As a result of this collection the UI feels really slow.

      I kicked the tires a bit and found that the we are using Softreferences for just about everying, which make it hard for the garbage collector to know what to do.

        Activity

        Patrick Corless created issue -
        Hide
        Patrick Corless added a comment -

        I updated the Library's ConcurrentHashMap for refs and lookupReference2ICCBased to use WeakReferences to give the GC a better hint of what can be pruned. As a result of this simple change the UI is buttery smooth while scrolling through a document with thousands of pages. The memory usage also seems to stay much further below the max memory.

        Show
        Patrick Corless added a comment - I updated the Library's ConcurrentHashMap for refs and lookupReference2ICCBased to use WeakReferences to give the GC a better hint of what can be pruned. As a result of this simple change the UI is buttery smooth while scrolling through a document with thousands of pages. The memory usage also seems to stay much further below the max memory.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #37290 Wed Jul 31 17:00:52 MDT 2013 patrick.corless PDF-627 update the ConcurrentHashMap caches to use WeakReferences instead of SoftReferences to help speed up garbage collection.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/util/Library.java
        Hide
        Patrick Corless added a comment -

        Updated both the trunk and the 5.0.1 branch with the library changes

        Show
        Patrick Corless added a comment - Updated both the trunk and the 5.0.1 branch with the library changes
        Patrick Corless made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #37292 Wed Jul 31 20:35:05 MDT 2013 patrick.corless PDF-627 update the ConcurrentHashMap caches to use WeakReferences instead of SoftReferences to help speed up garbage collection.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/Library.java
        Patrick Corless made changes -
        Fix Version/s 5.0.3 [ 11070 ]
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: