You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Foucault, Sebastien" <Se...@hraccess.com> on 2005/09/28 10:19:58 UTC
TR : Performance issues using Fo:marker
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