Skip to content

Fixes #6993. Evals cause memory leak.#6994

Merged
enebo merged 1 commit intojruby:jruby-9.3from
enebo:fix_ml
Jan 14, 2022
Merged

Fixes #6993. Evals cause memory leak.#6994
enebo merged 1 commit intojruby:jruby-9.3from
enebo:fix_ml

Conversation

@enebo
Copy link
Member

@enebo enebo commented Jan 14, 2022

This makes two changes. The first is to not record evals
as lexical children. In IR we actually only use lexical
children for IR persistence (and AOT compilation). We would
never persist a live eval instance.

This leads to the second change. anyUsesEval was using lexicalChildren
to detect for evals when trying to perform AOT compilation (which we
do not allow). This is better served by getClosures as we really
only care about "soft" scopes containing an eval (e.g. we don't
care if a method contains and eval if we are trying to AOT a module
scope (hard scope change) but we do care about a closure in a method
containing an eval (soft scope change)).

This makes two changes.  The first is to not record evals
as lexical children.  In IR we actually only use lexical
children for IR persistence (and AOT compilation).  We would
never persist a live eval instance.

This leads to the second change.  anyUsesEval was using lexicalChildren
to detect for evals when trying to perform AOT compilation (which we
do not allow).  This is better served by getClosures as we really
only care about "soft" scopes containing an eval (e.g. we don't
care if a method contains and eval if we are trying to AOT a module
scope (hard scope change) but we do care about a closure in a method
containing an eval (soft scope change)).
@enebo enebo added this to the JRuby 9.3.3.0 milestone Jan 14, 2022
@enebo enebo merged commit 5772c6b into jruby:jruby-9.3 Jan 14, 2022
@enebo enebo deleted the fix_ml branch January 14, 2022 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant