You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Greg Huber (JIRA)" <ji...@apache.org> on 2011/05/27 18:06:48 UTC

[jira] [Created] (WW-3637) Auto reload of properties slowing down application

Auto reload of properties slowing down application
--------------------------------------------------

                 Key: WW-3637
                 URL: https://issues.apache.org/jira/browse/WW-3637
             Project: Struts 2
          Issue Type: Bug
          Components: Other
    Affects Versions: 2.2.3
         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
            Reporter: Greg Huber


Hello, with this mod WW-3602 

private static void reloadBundles() {
..
bundlesMap.clear();
..
}

and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 

I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.

LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");

modified LocalizedTextUtil added method :

public static void removeBundle(String resourceBundle) {
if (reloadBundles) {

if (bundlesMap.containsKey(resourceBundle)) {
bundlesMap.remove(resourceBundle);
}
}
}

>From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.

Cheers Greg.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Greg Huber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043901#comment-13043901 ] 

Greg Huber commented on WW-3637:
--------------------------------

Yes, only with struts.devMode=true.

> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Greg Huber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048497#comment-13048497 ] 

Greg Huber commented on WW-3637:
--------------------------------

Works great.  thanks.

> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>             Fix For: 2.3
>
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WW-3637) Auto reload of properties slowing down application

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maurizio Cucchiara updated WW-3637:
-----------------------------------

    Priority: Minor  (was: Major)

Upgraded to minor, because it manifests only in dev mode.

> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>            Priority: Minor
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Greg Huber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043445#comment-13043445 ] 

Greg Huber commented on WW-3637:
--------------------------------

The mod mod on WW-3602  >>   bundlesMap.clear();

private static void reloadBundles() {
..
bundlesMap.clear();
..
} 

clears the complete map Each time.  My UI makes may calls to get properties from the bundle and hence the bundle map also gets cleared each time.

What is needed is the bundlesMap.clear(); to be called at the start of the request to only clear it once rather than each time to retrieve a property.

> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044308#comment-13044308 ] 

Hudson commented on WW-3637:
----------------------------

Integrated in Struts2 #310 (See [https://builds.apache.org/hudson/job/Struts2/310/])
    WW-3637 - Auto reload of properties slowing down application (Check null)

mcucchiara : 
Files : 
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java


> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>             Fix For: 2.3
>
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Jason Pyeron (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043893#comment-13043893 ] 

Jason Pyeron commented on WW-3637:
----------------------------------

Next question.

Can you confirm this delay only happens in dev mode?

> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Sébastien Bucci (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048499#comment-13048499 ] 

Sébastien Bucci commented on WW-3637:
-------------------------------------

Bonjour,

Je suis en congés et sans accès Internet.
Je serais de retour s'il n'y a pas de volcan qui explose le 26 juin.

@ Bientôt
Sébastien


> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>             Fix For: 2.3
>
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044262#comment-13044262 ] 

Hudson commented on WW-3637:
----------------------------

Integrated in Struts2 #309 (See [https://builds.apache.org/hudson/job/Struts2/309/])
    WW-3637 - Auto reload of properties slowing down application

mcucchiara : 
Files : 
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java


> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>             Fix For: 2.3
>
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3637) Auto reload of properties slowing down application

Posted by "Jason Pyeron (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043404#comment-13043404 ] 

Jason Pyeron commented on WW-3637:
----------------------------------

Trying to understand this.

Are you saying that the reloadBundles() is being called too many times per request?

or 

Are you saying that calling clear() on the bundlesMap is broken/bad?

> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (WW-3637) Auto reload of properties slowing down application

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maurizio Cucchiara closed WW-3637.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3
         Assignee: Maurizio Cucchiara

Now it would reload exactly one time per request.
Please let me know if it doesn't work.

> Auto reload of properties slowing down application
> --------------------------------------------------
>
>                 Key: WW-3637
>                 URL: https://issues.apache.org/jira/browse/WW-3637
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.2.3
>         Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
>            Reporter: Greg Huber
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>             Fix For: 2.3
>
>
> Hello, with this mod WW-3602 
> private static void reloadBundles() {
> ..
> bundlesMap.clear();
> ..
> }
> and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation. 
> I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.
> LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");
> modified LocalizedTextUtil added method :
> public static void removeBundle(String resourceBundle) {
> if (reloadBundles) {
> if (bundlesMap.containsKey(resourceBundle)) {
> bundlesMap.remove(resourceBundle);
> }
> }
> }
> From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.
> Cheers Greg.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira