[ https://issues.apache.org/jira/browse/WICKET-532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493800 ]
Martin Funk commented on WICKET-532: ------------------------------------ This made me play around with Runtime.getRuntime().totalMemory(); Runtime.getRuntime().freeMemory(); and System.gc(); Trying to get a hint on memory footprint. Wouldn't even dare to call em hard facts. On my system (64bit) new ArrayList(x) semms to be constantly 40 bytes bigger than new Object[x]. Also new ArrayList() seems to default to new ArrayList(10) So if one reasons that a FormComponent rarely ever has more than one validator attached, chances are that the original aproach relatively has a significantly more efficient memory usage. It's still ugly to read:-) So if bytes are to tight mention I'd only have this patch to add (though the method doesn't seem to be used): Index: wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java =================================================================== --- wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java (revision 535378) +++ wicket-1.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java (working copy) @@ -442,7 +442,7 @@ } else { - final List list = new ArrayList(); + final List list = new ArrayList(size - 1); for (int i = 0; i < size; i++) { list.add(validators_get(i)); > CodeSmell > jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java > -------------------------------------------------------------------------------------------- > > Key: WICKET-532 > URL: https://issues.apache.org/jira/browse/WICKET-532 > Project: Wicket > Issue Type: Improvement > Environment: svn info > Pfad: . > URL: https://svn.apache.org/repos/asf/incubator/wicket/trunk > Basis des Projektarchivs: https://svn.apache.org/repos/asf > UUID des Projektarchivs: 13f79535-47bb-0310-9956-ffa450edef68 > Revision: 535220 > Reporter: Martin Funk > Priority: Minor > Attachments: patch.txt > > > This is not a bug, it's rather a 'finger exercise'. > Whilst codereading I came across code I didn't understand, so I rewrote it. I > ended up with something that I find easier to read. > Maybe someone has some leasure time to read it and give me some feedback on > it. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.