[
https://issues.apache.org/jira/browse/SHINDIG-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ryan Baxter reopened SHINDIG-1867:
----------------------------------
Reopening because it breaks the Java 1.5 build.
> AllJsIFrameVersioner causes large memory allocation
> ---------------------------------------------------
>
> Key: SHINDIG-1867
> URL: https://issues.apache.org/jira/browse/SHINDIG-1867
> Project: Shindig
> Issue Type: Bug
> Components: Java
> Affects Versions: 2.5.0-beta4
> Reporter: Marshall Shi
> Fix For: 2.5.0, 2.5.0-beta5
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> 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 message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira