xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Foucault, Sebastien" <Sebastien.Fouca...@hraccess.com>
Subject TR : Performance issues using Fo:marker
Date Wed, 28 Sep 2005 08:19:58 GMT
Hello,

The problem can be easliy reproduced using the examples/fo/markers/hide.fo
samples with tiny modifications :

- remove the <fo:page-number-citation/> element to ensure that the OOM does
not come from the forward references
- remove the id="end-of-document" attribute
- duplicate many times the main page-sequence

I noticed that all the markers encountered within the document are stored in
a list at the document scope in the StreamRenderer (documentMarkers member).
This is the reason for high memory consumption.

In my case, I overcame the problem by storing only one instance of marker
per marker class name because I use a retrieve-position for the
retrieve-marker element compatible with such a behaviour
(last-starting.....).

   //
   // New method 
   private void addDocumentMarker( Marker _oMarker ) {
       for ( int i = 0 ; i < documentMarkers.size() ; i++ ) {
          Marker oMarker = (Marker) documentMarkers.get(i); 
          if (
oMarker.getMarkerClassName().equals(_oMarker.getMarkerClassName()) ) {
             documentMarkers.set(i,oMarker);
             return;
          }
       }
       
       documentMarkers.add(_oMarker);
    }
    
    public synchronized void queuePage(Page page)
    throws FOPException, IOException {

		// ...
            for (int i=0;i<markers.size();i++) {
                Marker marker = (Marker)markers.get(i);
                marker.releaseRegistryArea();
                currentPageSequenceMarkers.add(marker);
                
                // documentMarkers.add(marker);
                addDocumentMarker(marker);                
            }
        }
        



Regards
--
S├ębastien FOUCAULT


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message