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

Set map->load to 0 at the end of HashMapClear() #3594

Merged
merged 1 commit into from
Apr 15, 2019

Conversation

vpodzime
Copy link
Contributor

@vpodzime vpodzime commented Apr 9, 2019

Otherwise the size is unchanged and the map thinks it still has
all the items that were there before. The items are gone, but
when new ones are inserted, the table sooner or later hits the
threshold and grows automatically. Repeat this process of "insert
a couple hundred items, clear, repeat" multiple times and the
table grows and grows...and grows.

Ticket: CFE-3032
Changelog: Fix growing memory footprint of daemons

@cf-bottom
Copy link

Thanks for submitting a pull request! Maybe @olehermanse can review this?

@olehermanse olehermanse self-requested a review April 9, 2019 15:31
olehermanse
olehermanse previously approved these changes Apr 9, 2019
Copy link
Member

@olehermanse olehermanse left a comment

Choose a reason for hiding this comment

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

+1

@craigcomstock
Copy link
Contributor

Where's the unit test? :)

nickanderson
nickanderson previously approved these changes Apr 9, 2019
@vpodzime
Copy link
Contributor Author

vpodzime commented Apr 9, 2019

Where's the unit test? :)

Yeah, I think I will add something. It might be a bit tricky, though, the load field is an internal field.

@vpodzime
Copy link
Contributor Author

vpodzime commented Apr 9, 2019

@cf-bottom jenkins with exotics, please

@cf-bottom
Copy link

Otherwise the size is unchanged and the map thinks it still has
all the items that were there before. The items are gone, but
when new ones are inserted, the table sooner or later hits the
threshold and grows automatically. Repeat this process of "insert
a couple hundred items, clear, repeat" multiple times and the
table grows and grows...and grows.

Let's decrement map->load everytime we remove an item and assert
that it reaches 0 when all items are removed.

Ticket: CFE-3032
Changelog: Fix growing memory footprint of daemons
@vpodzime vpodzime dismissed stale reviews from nickanderson and olehermanse via 09e5d24 April 10, 2019 10:13
@vpodzime vpodzime force-pushed the master-fix_growing_memory branch from 244bc2b to 09e5d24 Compare April 10, 2019 10:13
@vpodzime
Copy link
Contributor Author

@cf-bottom jenkins with exotics again, please

@cf-bottom
Copy link

@vpodzime
Copy link
Contributor Author

@cf-bottom jenkins with exotics, AGAIN, please

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

(with exotics)

Jenkins: https://ci.cfengine.com/job/pr-pipeline/2306/

Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-2306/

@vpodzime
Copy link
Contributor Author

Alright, I triggered a build:

Build Status

All green except for the aborted deployment tests.

@vpodzime vpodzime requested a review from olehermanse April 12, 2019 13:48
@vpodzime vpodzime merged commit ae5e760 into cfengine:master Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants