You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Stanton Sievers <ss...@us.ibm.com> on 2011/10/19 20:15:09 UTC

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


Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by Stanton Sievers <ss...@us.ibm.com>.
Good find Jas.  What is the expected usage pattern for the MessageQueue 
that gets passed in?  Can you write up a Shindig JIRA for how a "real" 
implementation should work.  Or is using a DevNullMQ ok by default?

I'm just trying to understand the implications.

Thanks,
-Stanton



From:   ๏̯͡๏ Jasvir Nagra <ja...@google.com>
To:     dev@shindig.apache.org, 
Date:   10/19/2011 20:35
Subject:        Re: Memory concerns: what is the "normal" amount of 
CssTree.RuleSet objects to see at runtime



On Wed, Oct 19, 2011 at 5:01 PM, Ryan J Baxter <rj...@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: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   ๏̯͡๏ Jasvir Nagra <ja...@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
> <ss...@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 <ja...@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 <rj...@us.ibm.com>
> > wrote:
> >
> > > You want to ask Jasvir, he is the Caja lead at Google :)
> > >
> > > -Ryan
> > >
> > > Email: rjbaxter@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
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
>




Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by ๏̯͡๏ Jasvir Nagra <ja...@google.com>.
On Wed, Oct 19, 2011 at 5:01 PM, Ryan J Baxter <rj...@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: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   ๏̯͡๏ Jasvir Nagra <ja...@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
> <ss...@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 <ja...@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 <rj...@us.ibm.com>
> > wrote:
> >
> > > You want to ask Jasvir, he is the Caja lead at Google :)
> > >
> > > -Ryan
> > >
> > > Email: rjbaxter@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
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
>

Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by Stanton Sievers <ss...@us.ibm.com>.
If I'm reading the ehcacheConfig.xml file correctly, the cached entries 
don't expire after a given time.  Instead, the cache has a max element 
size of 1000 and once that limit is reached the least recently used 
elements will be expelled from the cache.

And to give closure to the problem I initially posted, the number of 
RuleSets I was seeing was normal for the CSS files that were being loaded. 
 A potential problem I see with the default cache configuration is that 
the cache will grow to 1000 elements.  In the case of the parsedCss cache 
those elements are CssTree$StyleSheet elements.  So that's 1000 style 
sheets that are loaded and if those style sheets are sufficiently large 
they will eat a lot of memory in the in memory cache. 

Is there a recommended way to deal with this?  I've noticed that EhCache 
2.5 has some nice config around maximum bytes on the local heap, off the 
heap, and on disk.  That seems like a better way to configure these 
potentially large caches.

Thanks,
-Stanton



From:   Ryan J Baxter/Westford/IBM@Lotus
To:     dev@shindig.apache.org, 
Date:   10/19/2011 20:02
Subject:        Re: Memory concerns: what is the "normal" amount of 
CssTree.RuleSet objects to see at runtime



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

Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile



From:   ๏̯͡๏ Jasvir Nagra <ja...@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 
<ss...@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 <ja...@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 <rj...@us.ibm.com>
> wrote:
>
> > You want to ask Jasvir, he is the Caja lead at Google :)
> >
> > -Ryan
> >
> > Email: rjbaxter@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
> >
> >
> >
> >
> >
>
>
>
>







Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by Ryan J Baxter <rj...@us.ibm.com>.
Jas does the cached entries expire at some point?  I assume this would be 
another configuration option...
-Ryan

Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile



From:   ๏̯͡๏ Jasvir Nagra <ja...@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 
<ss...@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 <ja...@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 <rj...@us.ibm.com>
> wrote:
>
> > You want to ask Jasvir, he is the Caja lead at Google :)
> >
> > -Ryan
> >
> > Email: rjbaxter@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
> >
> >
> >
> >
> >
>
>
>
>




Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by ๏̯͡๏ Jasvir Nagra <ja...@google.com>.
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 <ss...@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 <ja...@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 <rj...@us.ibm.com>
> wrote:
>
> > You want to ask Jasvir, he is the Caja lead at Google :)
> >
> > -Ryan
> >
> > Email: rjbaxter@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
> >
> >
> >
> >
> >
>
>
>
>

Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by Stanton Sievers <ss...@us.ibm.com>.
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 <ja...@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 <rj...@us.ibm.com> 
wrote:

> You want to ask Jasvir, he is the Caja lead at Google :)
>
> -Ryan
>
> Email: rjbaxter@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
>
>
>
>
>




Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by ๏̯͡๏ Jasvir Nagra <ja...@google.com>.
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 <rj...@us.ibm.com> wrote:

> You want to ask Jasvir, he is the Caja lead at Google :)
>
> -Ryan
>
> Email: rjbaxter@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
>
>
>
>
>

Re: Memory concerns: what is the "normal" amount of CssTree.RuleSet objects to see at runtime

Posted by Ryan J Baxter <rj...@us.ibm.com>.
You want to ask Jasvir, he is the Caja lead at Google :)

-Ryan

Email: rjbaxter@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