You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Ryan Baxter (JIRA)" <ji...@apache.org> on 2012/09/18 03:45:07 UTC
[jira] [Reopened] (SHINDIG-1867) AllJsIFrameVersioner causes large
memory allocation
[ 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