On Wed, Oct 19, 2011 at 5:01 PM, Ryan J Baxter <rjbax...@us.ibm.com> wrote:

> Jas does the cached entries expire at some point?  I assume this would be
> another configuration option...
> -Ryan
>

I am not sure.  Eyeballing the calls shindig's css parser and sanitizer make
into Caja bit more, I notice that the message queue which holds references
to the parse tree nodes is never flushed nor actually used.

Patch at http://codereview.appspot.com/5293050/ if someone could give a
quick look.


> Email: rjbax...@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   ๏̯͡๏ Jasvir Nagra <jas...@google.com>
> To:     dev@shindig.apache.org,
> Date:   10/19/2011 07:40 PM
> Subject:        Re: Memory concerns: what is the "normal" amount of
> CssTree.RuleSet objects to see at runtime
>
>
>
> A css rule-set is what just a css selector (or more accurately, one or
> more
> css selectors) and a block of css declarations. Eg:
>
> div { background-color: red; color: pink; }
>
> is a rule-set.  It depends on what you're parsing - typically, a
> stylesheet,
> webpage or gadget will have tens of rules and if you're caching across
> multiple such pages, this number can grow quickly.  Presumably, you'd
> adjust
> the EhCache capacity if these objects were overwhelming the cache.
>
> On Wed, Oct 19, 2011 at 12:53 PM, Stanton Sievers
> <ssiev...@us.ibm.com>wrote:
>
> > Thanks Jas.
> >
> > The parsed css cache is the one I was referring to.  EhCache is the
> cache
> > provider in this case, so that's probably why I was seeing EhCache
> > references to the Caja objects in the Eclipse MAT.
> >
> > I'll disable it and see what I can find.  In the meantime, would 1700 of
> > these RuleSets seem reasonable for a Shindig server?  Or is there no way
> > to tell?  ~1700 just seems like a lot, but I'm in no way an expert on
> what
> > those RuleSets are used for. :)
> >
> > Thanks,
> > -Stanton
> >
> >
> >
> > From:   ๏̯͡๏ Jasvir Nagra <jas...@google.com>
> > To:     dev@shindig.apache.org,
> > Date:   10/19/2011 15:06
> > Subject:        Re: Memory concerns: what is the "normal" amount of
> > CssTree.RuleSet objects to see at runtime
> >
> >
> >
> > And he hangs out here. :)
> >
> > As you'd expect, CssTree.RuleSets (and all the other parse tree nodes)
> are
> > retained as long as the root of the parse tree is retained.  Nothing in
> > the
> > Caja parser retains a reference to the root of the parse tree after the
> > parse.  In
> > Shindig,
> >
> >
>
> shindig/java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java
> > has a parsed css cache - is that the cache you're referring to?
> >
> > A quick check to test this would be to turn that off that cache and see
> if
> > you still see a lot of CssTree.Rulesets retained.
> >
> > jas
> >
> >
> > On Wed, Oct 19, 2011 at 11:48 AM, Ryan J Baxter <rjbax...@us.ibm.com>
> > wrote:
> >
> > > You want to ask Jasvir, he is the Caja lead at Google :)
> > >
> > > -Ryan
> > >
> > > Email: rjbax...@us.ibm.com
> > > Phone: 978-899-3041
> > > developerWorks Profile
> > >
> > >
> > >
> > > From:   Stanton Sievers/Westford/IBM@Lotus
> > > To:     dev@shindig.apache.org,
> > > Date:   10/19/2011 02:21 PM
> > > Subject:        Memory concerns: what is the "normal" amount of
> > > CssTree.RuleSet objects to see at runtime
> > >
> > >
> > >
> > > Hi everyone,
> > >
> > > I'm seeing a lot of com.google.caja.parser.css.CssTree$RuleSet objects
> > > when running Shindig.  I'm seeing around 1700 of these RuleSet objects
> > > being retained, which equates to between 9MB and 10MB.  This
> constitutes
> > > ~15% of the total heap size!  These RuleSets appear to be in an
> > ArrayList
> > > that is referenced by com.google.caja.parser.ChildNodes (at least
> > > according to Eclipse Memory Analyzer).
> > >
> > > Is this normal?  Is it possible EhCache is hanging onto a bunch of
> these
> > > objects?
> > >
> > > I want to get everyone's opinion here before I post something to the
> > Caja
> > > folks.
> > >
> > > Thanks,
> > > -Stanton
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
>

Reply via email to