You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org> on 2010/03/04 01:49:29 UTC

[jira] Created: (TRINIDAD-1747) zip page state to reduce live memory

zip page state to reduce live memory
------------------------------------

                 Key: TRINIDAD-1747
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
             Project: MyFaces Trinidad
          Issue Type: Improvement
            Reporter: Gabrielle Crawford


PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Resolved: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf resolved TRINIDAD-1747.
------------------------------------------

    Fix Version/s: 2.0.0.3-core
       Resolution: Fixed

> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>             Fix For: 2.0.0.3-core
>
>         Attachments: 1.2.12.1_compressviewstate.patch, 1.2.12.2_compressviewstate.patch, ObjectInputStreamResolveClass_for_trinidad2, TRINIDAD-1747_August10.patch, trunk_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Commented: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851517#action_12851517 ] 

Gabrielle Crawford commented on TRINIDAD-1747:
----------------------------------------------

we always save the state, and then we cache the last view, so that most of the time we don't have to do restoreState. 

We do handle windows, you can look for calls to trinContext.getWindowManager().getCurrentWindow in the state manager code.

> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch, 1.2.12.2_compressviewstate.patch, trunk_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Commented: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851185#action_12851185 ] 

Gabrielle Crawford commented on TRINIDAD-1747:
----------------------------------------------

- "100Megs of page state - for one user? This is incredibly high! I guess you are talking about multiple users? "
Sorry, should have said, 200 users

- "why do you have a page-state independent of the implementation´s page state? I don´t understand this."   
we do some things in our statemanager like cache the view root of the last view you looked at, which means we don't even have to restore the state, we just return the old tree.

> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch, 1.2.12.2_compressviewstate.patch, trunk_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Issue Comment Edited: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846583#action_12846583 ] 

Gabrielle Crawford edited comment on TRINIDAD-1747 at 3/17/10 9:06 PM:
-----------------------------------------------------------------------

This issue is proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

time(secs) no serialization:     0.57           
time(secs) serialization :       0.58   
time(secs) compress:        0.587

CPU usage no serialization:     29%           
CPU usage serialization :      30%   
CPU usage compress:        30.7%

page state memory no serialization: 100M         
page state memory compress:  9.8M

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.

      was (Author: gabrielle):
    We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

time(secs) no serialization:     0.57           
time(secs) serialization :       0.58   
time(secs) compress:        0.587

CPU usage no serialization:     29%           
CPU usage serialization :      30%   
CPU usage compress:        30.7%

page state memory no serialization: 100M         
page state memory compress:  9.8M

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.
  
> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Issue Comment Edited: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846583#action_12846583 ] 

Gabrielle Crawford edited comment on TRINIDAD-1747 at 3/17/10 9:03 PM:
-----------------------------------------------------------------------

We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

                        no serialization    serialization     zipping
time(secs)     &nbsp; &nbsp;         0.57                    0.58           0.587
CPU usage               29%                     30%            30.7%
state memory           100M                                    9.8M
</code></pre>

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.

      was (Author: gabrielle):
    We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

<pre><code>
                        no serialization    serialization     zipping
time(secs)               0.57                    0.58           0.587
CPU usage               29%                     30%            30.7%
state memory           100M                                    9.8M
</code></pre>

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.
  
> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Issue Comment Edited: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846583#action_12846583 ] 

Gabrielle Crawford edited comment on TRINIDAD-1747 at 3/17/10 9:02 PM:
-----------------------------------------------------------------------

We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

<pre><code>
                        no serialization    serialization     zipping
time(secs)               0.57                    0.58           0.587
CPU usage               29%                     30%            30.7%
state memory           100M                                    9.8M
</code></pre>

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.

      was (Author: gabrielle):
    We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

                        no serialization    serialization     zipping
time(secs)               0.57                    0.58           0.587
CPU usage               29%                     30%            30.7%
state memory           100M                                    9.8M

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.
  
> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Commented: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855958#action_12855958 ] 

Matthias Weßendorf commented on TRINIDAD-1747:
----------------------------------------------

thread for "problems" with Mojarra/Trinidad client-state-saving is here:
http://markmail.org/message/x6ktrew5uot27wrq

> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch, 1.2.12.2_compressviewstate.patch, ObjectInputStreamResolveClass_for_trinidad2, trunk_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851176#action_12851176 ] 

Martin Marinschek commented on TRINIDAD-1747:
---------------------------------------------

A few questions to this (sorry, I am a bit late):

- 100Megs of page state - for one user? This is incredibly high! I guess you are talking about multiple users?

- why do you have a page-state independent of the implementation´s page state? I don´t understand this.

best regards,

Martin

> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch, 1.2.12.2_compressviewstate.patch, trunk_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Issue Comment Edited: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846583#action_12846583 ] 

Gabrielle Crawford edited comment on TRINIDAD-1747 at 3/17/10 9:06 PM:
-----------------------------------------------------------------------

We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

time(secs) no serialization:     0.57           
time(secs) serialization :       0.58   
time(secs) compress:        0.587

CPU usage no serialization:     29%           
CPU usage serialization :      30%   
CPU usage compress:        30.7%

page state memory no serialization: 100M         
page state memory compress:  9.8M

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.

      was (Author: gabrielle):
    We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

                        no serialization    serialization     zipping
time(secs)     &nbsp; &nbsp;         0.57                    0.58           0.587
CPU usage               29%                     30%            30.7%
state memory           100M                                    9.8M
</code></pre>

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.
  
> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Commented: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846583#action_12846583 ] 

Gabrielle Crawford commented on TRINIDAD-1747:
----------------------------------------------

We'd are proposing a context param to control whether or not to compress the page state, this is similar to the mojarra context param com.sun.faces.compressViewState. see 
http://wiki.glassfish.java.net/Wiki.jsp?page=JavaServerFacesRI

For now we propose an internal context param, "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE". For now the default will be off. 

Here are the results of testing the code

                        no serialization    serialization     zipping
time(secs)               0.57                    0.58           0.587
CPU usage               29%                     30%            30.7%
state memory           100M                                    9.8M

As you can see, zipping greatly reduced the memory being taken up by page state.

You may wonder why we tested zipping against serializing the page state. When failover is implemented, values on the session are serialized, so any scalable application is going to be serializing the page state already. 

If people test this and find that it's working with a minimal performance hit we can consider whether to make this public and if so whether to default it to on.

> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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


[jira] Commented: (TRINIDAD-1747) zip page state to reduce live memory

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851191#action_12851191 ] 

Martin Marinschek commented on TRINIDAD-1747:
---------------------------------------------

That sounds reasonable.

Question: do you anyways save the state, or only cache? what do you do if the user spawns a new window for the same view?

best regards,

Martin

> zip page state to reduce live memory
> ------------------------------------
>
>                 Key: TRINIDAD-1747
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1747
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>            Reporter: Gabrielle Crawford
>         Attachments: 1.2.12.1_compressviewstate.patch, 1.2.12.2_compressviewstate.patch, trunk_compressviewstate.patch
>
>
> PageState Objects tend to pin a lot of live memory. These objects are heavy in live memory and can use a couple of MB per object. This is very big overhead and becomes much bigger issue in clustering when session replication happens.

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