Memory Management and Caching

compared with
Current by Patrick Corless
on Mar 26, 2013 11:50.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 5 changes. View first change.

 \\
 An Adobe PDF file consists of numerous compressed streams. As a PDF file is opened and additional pages are viewed, more streams are decompressed, and the memory required to display the content grows significantly.
  An Adobe PDF file consists of numerous compressed streams. As a PDF file is opened and additional pages are viewed, more streams are decompressed, and the memory required to display the content can grow significantly.
  
When the amount of free Java heap memory becomes low, the ICEpdf Memory Manager frees up memory by disposing of the PDF objects associated with previously viewed pages, until the required amount of memory is recovered.
  All loaded PDF objects are stored in the Documents Library and are accessible via a ConcurrentHashMap<Reference, SoftReference<Object>> structures. The memory management is handle by the JDK Soft and Weak Reference implementations. This approach will insure that Objects will be released for Garbage collection in a timely efficient fashion.
  
{info:title=Note}Memory is considered low if the Runtime maxMemory value, minus the current amount of used Java heap, is less than the specified {{{*}org.icepdf.core.minMemory{*}}} value.
 {info}
 When an image stream is encountered, it is first represented as a byte stream and then encoded into a viewable image. This process can be time consuming and memory intensive. The image is stored in memory until the Memory Manager disposes of its parent page resources, at which time the encoded image may be written to disk and the representation of the image in memory is flushed. If needed later, the cached image is read from disk, which may be more efficient than re-decoding the byte stream and re-encoding the image.
  If garbage collection is slowing UI responsiveness then it is recommend ICEpdf Viewer RI be run with the system property -XX:+UseConcMarkSweepGC. This garbage collection algorithm seems to improve ICEpdf's responsiveness when working with larger files.
  
{info:title=Note}In some environments, file caching may not be desirable. If necessary, you can turn off caching completely by setting the system property {{{*}org.icepdf.core.imagecache.enabled{*}}} to false. However, you should not disable file caching if your PDF documents contain large images or several images unless you have a large Java Heap available (512 MB or more).
  There are some PDF documents which require a larger then normal amount of JVM memory. Large memory requirements are generally always related to large embedded images. In such a circumstance is is recommended that the JVM is given more memory by using the the system property -Xmx###m where ### represents the amount of memory in MegaBytes to assigned to the JVM.
  
 {info}For more information on the ICEpdf system properties, see {color:#004ca5}*[System Properties]*{color}.
 {info}
 For more information on the ICEpdf system properties, see {color:#004ca5}*[System Properties]*{color}.
 \\
 \\

© Copyright 2017 ICEsoft Technologies Canada Corp.