lhotari commented on PR #24423: URL: https://github.com/apache/pulsar/pull/24423#issuecomment-2982942793
Regarding the TopicListWatcher, it will consume a significant amount of heap memory if the topic names aren't deduplicated String instances: https://github.com/apache/pulsar/blob/3bae1d1648edcedd03973476ef281715499a549e/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicListService.java#L47 Guava's Interner class is a good way to deduplicate String instances. Example from Gradle source code: https://github.com/gradle/gradle/blob/master/platforms/core-runtime/base-services/src/main/java/org/gradle/api/internal/cache/StringInterner.java . The usage of `java.lang.String.intern` could be problematic since the GC of the instances isn't well defined. -- 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]
