> On Sept. 18, 2012, 12:37 a.m., Ryan Baxter wrote: > > Committed revision 1386936
I had to revert this change because String.getBytes(Charset) is only in Java 1.6 so the Java 1.5 build fails. We need to support Java 1.5 for Shindig 2.5.0. - Ryan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/7074/#review11640 ----------------------------------------------------------- On Sept. 15, 2012, 11:02 p.m., Marshall Shi wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/7074/ > ----------------------------------------------------------- > > (Updated Sept. 15, 2012, 11:02 p.m.) > > > Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and > Rich Thompson. > > > Description > ------- > > The AllJsIframeVersioner causes a massive memory allocation executing the > following: > > StringBuilder jsBuf = new StringBuilder(); > for (FeatureResource resource : registry.getAllFeatures().getResources()) { > jsBuf.append(resource.getContent()).append(resource.getDebugContent()); > } > this.allJsChecksum = HashUtil.checksum(jsBuf.toString().getBytes()); > > The two problems with this are: > (1) Creates a massive char[] for that string (we tested with a 4M resource) > (2) Then allocates a new byte[] for that giant string > > Proposed solution is to just use a simple message digest object against each > resource content. And concat all the bytes for HashUtil.checksum. > > > This addresses bug SHINDIG-1867. > https://issues.apache.org/jira/browse/SHINDIG-1867 > > > Diffs > ----- > > > http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/AllJsIframeVersioner.java > 1384320 > > http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/uri/AllJsIframeVersionerTest.java > 1384320 > > Diff: https://reviews.apache.org/r/7074/diff/ > > > Testing > ------- > > Done. > > > Thanks, > > Marshall Shi > >