On Jul 18, 2007, at 22:17, Jeremias Maerki wrote:
FWIW: going over those initial figures again, and
Class
Name |
Objects |Shallow Heap |Retained Heap |Perm
----------------------------------------------------------------------
-----------------------------------------------
org.apache.fop.fo.properties.CondLengthProperty
| 315'760| 7'578'240| 7'578'240|
These still seem to eating up quite some memory. I've also been
looking at those, but the big bugger here is the Length-component,
which can be a PercentLength, and as such is currently non-eligible
for caching... :(
If this could somehow be circumvented, we could easily reach the
stadium of caching entire CommonBorderPaddingBackground bundles.
org.apache.fop.fo.flow.Block
| 26'391| 4'855'944| 54'554'584|
org.apache.fop.fo.properties.SpaceProperty
| 87'592| 4'204'416| 7'160'880|
org.apache.fop.fo.properties.CommonBorderPaddingBackground
| 78'940| 3'789'120| 16'419'968|
org.apache.fop.fo.properties.KeepProperty
| 110'661| 3'541'152| 3'541'152|
KeepProperty's also one I might look into very soon. The three
components are all either enums or absolute numbers, so caching those
should prove to be quite doable. As to SpaceProperty, again the
possibility of PercentLengths prevents caching from having any use at
all. The main blocker here is that there's a reference to the FObj
stored in the implied LengthBase, which makes each PercentLength
specific to the FObj it was created for...
As a closing note for this one:
How about scrapping the CommonHyphenation, CommonFont etc. entirely,
and binding the applicable properties to the FONodes directly instead?
In the layout-code, you would not have:
boolean hyphenate = ((Block) fo).getCommonHyphenation
().isHyphenateEnabled();
but simply:
boolean hyphenate = ((Block) fo).isHyphenateEnabled();
Seems much cleaner. Although I'm still not entirely happy about the
property access, this already looks much more readable and avoids the
overhead of the bundle-instances themselves altogether...
Cheers
Andreas