Re: Leaking LambdaForm classes?

2017-01-06 Thread Charles Oliver Nutter
On Fri, Jan 6, 2017 at 2:59 PM, Vladimir Ivanov <
vladimir.x.iva...@oracle.com> wrote:

> LambdaForm caches deliberately keep LF instances using SoftReferences.
>
> The motivation is:
>   (1) LFs are heavily shared;
>   (2) LFs are expensive to construct (LF interpreter is turned off by
> default now); it involves the following steps: new LF instance + compile to
> bytecode + class loading.
>
> So, keeping a LF instance for a while usually pays off, especially during
> startup/warmup. There should be some heap/metaspace pressure to get them
> cleared.
>
> As a workaround, try -XX:SoftRefLRUPolicyMSPerMB=0 to make soft references
> behave as weak.


I'll pass that along, thank you. I'm not sure how vigorously he's tried to
get GC to clear things out.

Not sure the problem relates to j.l.i & LFs since the report says indy in
> jruby is turned off. For heavy usages of indy/j.l.i 1000s of LFs are
> expected (<5k). The question is how does the count change over time.
>

JRuby has progressed to the point of using method handles and indy all the
time, since for some cases the benefits are present without any issues.
"Enabling" indy in JRuby mostly just turns on the use of indy for method
call sites and instance variables now.

That said, the numbers this user is reporting do seem really high, which is
why I asked in here for similar stories. Even if we considered a very large
Ruby application with many hundreds of files, we'd still see non-indy MH
usages in JRuby in thousands at best (mostly for "constant" lookup sites).

- Charlie
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev


Re: Leaking LambdaForm classes?

2017-01-06 Thread Vladimir Ivanov

LambdaForm caches deliberately keep LF instances using SoftReferences.

The motivation is:
  (1) LFs are heavily shared;
  (2) LFs are expensive to construct (LF interpreter is turned off by 
default now); it involves the following steps: new LF instance + compile 
to bytecode + class loading.


So, keeping a LF instance for a while usually pays off, especially 
during startup/warmup. There should be some heap/metaspace pressure to 
get them cleared.


As a workaround, try -XX:SoftRefLRUPolicyMSPerMB=0 to make soft 
references behave as weak.


On 1/6/17 8:32 PM, Charles Oliver Nutter wrote:

Anyone else encountered this?

https://github.com/jruby/jruby/issues/4391


Not sure the problem relates to j.l.i & LFs since the report says indy 
in jruby is turned off. For heavy usages of indy/j.l.i 1000s of LFs are 
expected (<5k). The question is how does the count change over time.


Best regards,
Vladimir Ivanov




We have a user reporting metaspace getting filled up with LambdaForm
classes that have no instances. I would not expect this to happen given
that they're generated via AnonymousClassloader and we would need to
hold a reference to them to keep them alive.

I'm trying to get a heap dump from this user. If anyone has other
suggestions, feel free to comment on the issue.

- Charlie


___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev


___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev


Re: Leaking LambdaForm classes?

2017-01-06 Thread John Rose
Could be LF caching gone rogue. Does the user create many LF shapes, e.g. one 
per datum?

– John

> On Jan 6, 2017, at 9:32 AM, Charles Oliver Nutter  wrote:
> 
> Anyone else encountered this?
> 
> https://github.com/jruby/jruby/issues/4391
> 
> We have a user reporting metaspace getting filled up with LambdaForm classes 
> that have no instances. I would not expect this to happen given that they're 
> generated via AnonymousClassloader and we would need to hold a reference to 
> them to keep them alive.
> 
> I'm trying to get a heap dump from this user. If anyone has other 
> suggestions, feel free to comment on the issue.
> 
> - Charlie
> ___
> mlvm-dev mailing list
> mlvm-dev@openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev


Leaking LambdaForm classes?

2017-01-06 Thread Charles Oliver Nutter
Anyone else encountered this?

https://github.com/jruby/jruby/issues/4391

We have a user reporting metaspace getting filled up with LambdaForm
classes that have no instances. I would not expect this to happen given
that they're generated via AnonymousClassloader and we would need to hold a
reference to them to keep them alive.

I'm trying to get a heap dump from this user. If anyone has other
suggestions, feel free to comment on the issue.

- Charlie
___
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev