You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Marshall Shi (JIRA)" <ji...@apache.org> on 2012/09/12 15:59:07 UTC
[jira] [Created] (SHINDIG-1867) AllJsIFrameVersioner causes large
memory allocation
Marshall Shi created SHINDIG-1867:
-------------------------------------
Summary: 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
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
[jira] [Reopened] (SHINDIG-1867) AllJsIFrameVersioner causes large
memory allocation
Posted by "Ryan Baxter (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Updated] (SHINDIG-1867) AllJsIFrameVersioner causes large
memory allocation
Posted by "Ryan Baxter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan Baxter updated SHINDIG-1867:
---------------------------------
Fix Version/s: 2.5.0-beta5
2.5.0
> 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
[jira] [Updated] (SHINDIG-1867) AllJsIFrameVersioner causes large
memory allocation
Posted by "Marshall Shi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Shi updated SHINDIG-1867:
----------------------------------
Attachment: JIRA1867.patch
Attach the patch for this JIRA.
> 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
>
> Attachments: JIRA1867.patch
>
> 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
[jira] [Resolved] (SHINDIG-1867) AllJsIFrameVersioner causes large
memory allocation
Posted by "Ryan Baxter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan Baxter resolved SHINDIG-1867.
----------------------------------
Resolution: Fixed
Committed revision 1386936
> 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
[jira] [Resolved] (SHINDIG-1867) AllJsIFrameVersioner causes large
memory allocation
Posted by "Dan Dumont (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Dumont resolved SHINDIG-1867.
---------------------------------
Resolution: Fixed
Committed r1387677
> 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