Bug 51808 - Minor memory waste in Area
Summary: Minor memory waste in Area
Status: RESOLVED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 1.0
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-14 11:11 UTC by Sergey Vladimirov
Modified: 2012-04-06 18:12 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vladimirov 2011-09-14 11:11:22 UTC
It is usual for Area::props to have 1-2 properties, not 20. From other point, 20 seems to be max cap. To prevent memory waste HashMap(20) should be replaced with TreeMap().
Comment 1 Glenn Adams 2012-04-04 22:15:43 UTC
feel free to propose a patch; in the mean time, closing due to lack of action
Comment 2 Glenn Adams 2012-04-05 05:04:37 UTC
on further consideration, Sergey, if you could provide some data that shows relative gain/loss in heap use and processing time for an large FO file of 'typical' complexity when using the current code HashMap(20) versus TreeMap, then I would be inclined to make this change (assuming the data favors TreeMap);
Comment 3 Glenn Adams 2012-04-06 18:12:57 UTC
analysis shows that 98% of trait maps contain 3 entries with remainder containing 1 entry; changing to tree map results in a 2% memory savings compared to overall usage by java.util.* classes at IFDocumentHandler.endPage() call time; time performance also improved (marginally) with tree map, so there are no negatives in making this change

see http://svn.apache.org/viewvc?view=revision&revision=1310524