Will-Lo commented on a change in pull request #3335:
URL: https://github.com/apache/gobblin/pull/3335#discussion_r678604526



##########
File path: 
gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java
##########
@@ -116,7 +116,8 @@ public static Properties configToProperties(Config config, 
Optional<String> pref
       Config resolvedConfig = config.resolve();
       for (Map.Entry<String, ConfigValue> entry : resolvedConfig.entrySet()) {
         if (!prefix.isPresent() || entry.getKey().startsWith(prefix.get())) {
-          String propKey = desanitizeKey(entry.getKey());
+          // Intern the string so that constant keys are not duplicated to 
save memory
+          String propKey = desanitizeKey(entry.getKey()).intern();

Review comment:
       @umustafi thanks for the callout, it defaults to ~60k strings which is 
likely more than enough for keys (as we have a fixed number of configuration 
keys that should not exceed that number) but I will add the argument 
`-XX:+PrintStringTableStatistics` so that I can see how many we're actually 
using. These arguments would be in the service deployable runtime args, so it 
wouldn't be included in this repository.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to