You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Mike Atkin (JIRA)" <xa...@xml.apache.org> on 2007/10/11 17:44:50 UTC

[jira] Created: (XALANJ-2407) Reduce memory footprint of Templates instances

Reduce memory footprint of Templates instances
----------------------------------------------

                 Key: XALANJ-2407
                 URL: https://issues.apache.org/jira/browse/XALANJ-2407
             Project: XalanJ2
          Issue Type: Improvement
          Components: XSLTC
    Affects Versions: 2.7
            Reporter: Mike Atkin
            Priority: Minor
             Fix For: 2.7.1


TemplatesImpl retains the bytecode byte[]s for the compiled xsls even after generating the translet classes when there appears no reason for it.  This significantly increases memory usage of Templates objects (by an order of magnitude).  In my application (a small low-volume web app) which keeps a HashMap of 100 or so Templates, 40% of the heap space (64mb configured) is taken up by this data.

Setting the _bytecodes field to null (possibly adding a system flag or property to control this) at the end of the defineTransletClasses() method in TemplatesImpl fixes this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2407) Reduce memory footprint of Templates instances

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534295 ] 

Henry Zongaro commented on XALANJ-2407:
---------------------------------------

Good point.  I don't see any reason why XSLTC even needs that _bytecodes field - it seems to me it should probably just create the classes from within the constructor.

> Reduce memory footprint of Templates instances
> ----------------------------------------------
>
>                 Key: XALANJ-2407
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2407
>             Project: XalanJ2
>          Issue Type: Improvement
>          Components: XSLTC
>    Affects Versions: 2.7
>            Reporter: Mike Atkin
>            Priority: Minor
>             Fix For: 2.7.1
>
>
> TemplatesImpl retains the bytecode byte[]s for the compiled xsls even after generating the translet classes when there appears no reason for it.  This significantly increases memory usage of Templates objects (by an order of magnitude).  In my application (a small low-volume web app) which keeps a HashMap of 100 or so Templates, 40% of the heap space (64mb configured) is taken up by this data.
> Setting the _bytecodes field to null (possibly adding a system flag or property to control this) at the end of the defineTransletClasses() method in TemplatesImpl fixes this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2407) Reduce memory footprint of Templates instances

Posted by "Mike Atkin (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539603 ] 

Mike Atkin commented on XALANJ-2407:
------------------------------------

It looks like it will be hard to move the generation to the constructor given the Exceptions that are are thrown from the defineTransletClasses() method while maintaining backwards compatability.  I've attached a small patch to fix this using the original suggestion, which also removes the unused getter and setter for that field (doesn't seem to be any need for them).

> Reduce memory footprint of Templates instances
> ----------------------------------------------
>
>                 Key: XALANJ-2407
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2407
>             Project: XalanJ2
>          Issue Type: Improvement
>          Components: XSLTC
>    Affects Versions: 2.7
>            Reporter: Mike Atkin
>            Priority: Minor
>             Fix For: 2.7.1
>
>         Attachments: XALANJ-2407.diff
>
>
> TemplatesImpl retains the bytecode byte[]s for the compiled xsls even after generating the translet classes when there appears no reason for it.  This significantly increases memory usage of Templates objects (by an order of magnitude).  In my application (a small low-volume web app) which keeps a HashMap of 100 or so Templates, 40% of the heap space (64mb configured) is taken up by this data.
> Setting the _bytecodes field to null (possibly adding a system flag or property to control this) at the end of the defineTransletClasses() method in TemplatesImpl fixes this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org