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

Fixes #15676: Remove Map#keySet because of memory not freed #2453

Conversation

fanf
Copy link
Member

@fanf fanf commented Sep 10, 2019

@fanf
Copy link
Member Author

fanf commented Sep 10, 2019

We will wait for 5.0.14 and real tests for that one.

@@ -188,9 +188,9 @@ class HistorizationServiceImpl(
}
}.toSeq.map { case (t,fat,d) => (d, fat.toActiveTechnique, t) }

val stringDirectiveIds = directives.keySet.map( _.value)
val stringDirectiveIds = directives.keysIterator.toSet.map( _.value)
Copy link
Member

Choose a reason for hiding this comment

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

wow, this fails
[ERROR] /root/dev/rudder/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/services/eventlog/HistorizationService.scala:191: error: missing parameter type for expanded function ((x$4: ) => x$4.value)
[ERROR] val stringDirectiveIds = directives.keysIterator.toSet.map( _.value)
[ERROR] ^

i have no idea why ...

Copy link
Member

Choose a reason for hiding this comment

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

doing it in 2 steps fixes the issues
val directiveSet = directives.keysIterator.toSet
val stringDirectiveIds = directiveSet.map( _.value)

@@ -289,7 +289,7 @@ object QSLdapBackend {

if(m.size != QSAttribute.all.size) {
throw new IllegalArgumentException("Be carefull, it seems that the list of attributes in QSAttribute was modified, but not the list of name mapping" +
s"Please check for '${(m.keySet.diff(QSAttribute.all)++QSAttribute.all.diff(m.keySet)).mkString("', '")}'"
s"Please check for '${(m.keysIterator.toSet.diff(QSAttribute.all)++QSAttribute.all.diff(m.keysIterator)).mkString("', '")}'"
Copy link
Member

Choose a reason for hiding this comment

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

missing a toSet here

@ncharles ncharles closed this Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants