Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear resolved things in global context after render #227

Merged
merged 2 commits into from
Aug 22, 2018

Conversation

boulter
Copy link
Contributor

@boulter boulter commented Aug 22, 2018

When calling Jinjava.renderForResult, resolved variables, functions and expressions were added all the way up to the global context, but were never cleared. This created a memory leak where resolved expressions kept accumulating in these maps.

Clear these transient values after each render.

@boulter boulter requested review from mattcoley and hs-lsong August 22, 2018 21:04
Copy link
Collaborator

@mattcoley mattcoley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-io
Copy link

codecov-io commented Aug 22, 2018

Codecov Report

Merging #227 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #227      +/-   ##
============================================
+ Coverage     71.42%   71.45%   +0.03%     
- Complexity     1374     1375       +1     
============================================
  Files           218      218              
  Lines          4343     4348       +5     
  Branches        689      689              
============================================
+ Hits           3102     3107       +5     
  Misses         1000     1000              
  Partials        241      241
Impacted Files Coverage Δ Complexity Δ
...in/java/com/hubspot/jinjava/interpret/Context.java 77.9% <100%> (+0.52%) 78 <1> (+1) ⬆️
src/main/java/com/hubspot/jinjava/Jinjava.java 97.67% <100%> (+0.05%) 16 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9eb073a...40fa0bb. Read the comment docs.

@boulter boulter merged commit e0b1016 into master Aug 22, 2018
@boulter boulter deleted the clear-resolved-in-global-context branch August 22, 2018 21:46
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.

4 participants