Hi,

You are right that the Query class contains a cache of all expressions
(instances of Query). It is a static HashMap in WW1.3 so it is never GC'd as
you know.
I can see a couple of cases that would make it grow:

1. Parameters that are sent in requests are set on actions with the help of
the Query class. If you always have new parameter names, then they will
generate new Query objects that will fill up the cache. So for example the
parameters:  myaction.action?paramOne=2&otherParam/subProperty=4    this
would create 2 new Query instances (and 3 QuerySegments I believe).
Do you have some parameters that have dynamic names?

2. Some usages of the expand functionality of the expression language (when
you use braces { } ) can give many Query objects. For example if you write:
<ww:property value="{myProp}"/> then myProp is looked up, and whatever
String myProp contains is then looked up. This means that if myProp contains
different String values all the time then alot of Query instances will be
created.

Do you think your application involves any of those cases?
Perhaps you can add an accessor method to the Query class that would allow
you to get hold of the static Map and then you can print it out to see what
expressions it contains.

You can also try changing the Map to be a WeakHashMap and then the Query
instances could be GC'd. But of course it would be better to find the real
cause of the problem first.

Please come back with more information if you manage to find anything.

Cheers,

Dick Zetterberg

----- Original Message -----
From: "Paolo Vedovato" <[EMAIL PROTECTED]>
To: "WebWork List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 03, 2004 4:37 PM
Subject: RE: [OS-webwork] WW1.3 Memory Consumption


> Just a clarification to my previous mail:
>
> What I can't explain and seems wrong to me is that when I do the
> same load test again and again the instance count of Query and
> QuerySegment grows.
>
> What I instead expected was that after the first load test, the
> instance count wouldn't grow anymore.
>
> As far as I can remember this is the ValueStack Query cache,
> so it has not to be garbage collected, but I don't see why
> this cache is growing.
>
> Is this correct?
>
> Cheers
> -Paolo
>
>
> > -----Original Message-----
> > From: Paolo Vedovato [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 03, 2004 1:51 PM
> > To: WebWork List
> > Subject: [OS-webwork] WW1.3 Memory Consumption
> >
> >
> > Hi
> >
> > We are having some memory cosumption problems with our
> > webapplication (using ww 1.3) in our productive environment.
> > So we are currently profiling it.
> >
> > The memory profiling showed that these 2 webwork classes
> > are not garbage collected and grow during time:
> >
> > webwork.util.QuerySegment
> > webwork.util.Query
> >
> > After some load testing we see that these two
> > classes are consuming most of the memory
> > (on the first and second place when sorting
> > on the memory size).
> >
> > Can we do something about it?
> >
> > Thanks for your help.
> > -Paolo
> >
> >
> > -------------------------------------------------------
> > The SF.Net email is sponsored by EclipseCon 2004
> > Premiere Conference on Open Tools Development and Integration
> > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> > http://www.eclipsecon.org/osdn
> > _______________________________________________
> > Opensymphony-webwork mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to