Search before reporting
Read release policy
User environment
4.0.5
Issue Description
See #24458 (review)
Error messages
Reproducing the issue
Run the standalone.
Run the following application a few times:
final var admin = PulsarAdmin.builder().serviceHttpUrl("http://localhost:8080").build();
final var random = new Random();
for (int i = 0; i < 100000; i++) {
final var topic = "new-test-" + random.nextInt(10000000);
admin.topics().createNonPartitionedTopic(topic);
admin.topics().delete(topic);
}
Even though there is no traffic, the TopicName's cache kept growing.
There were only 3 active topics but 20.3k TopicName cache entries.
Additional information
It's caused by the design of #23052, which has no limits to the TopicName's cache. It relies on the scheduled task to clear the whole cache if the size has reached 200000, the task is scheduled every 2 hours.
P.S. The proxy side didn't schedule the task before, so it caused an OOM here #24445
From the benchmark shown here, the performance of the cache will be downgraded if there are many keys.
Are you willing to submit a PR?
Search before reporting
Read release policy
User environment
4.0.5
Issue Description
See #24458 (review)
Error messages
Reproducing the issue
Run the standalone.
Run the following application a few times:
Even though there is no traffic, the
TopicName's cache kept growing.There were only 3 active topics but 20.3k
TopicNamecache entries.Additional information
It's caused by the design of #23052, which has no limits to the
TopicName's cache. It relies on the scheduled task to clear the whole cache if the size has reached 200000, the task is scheduled every 2 hours.P.S. The proxy side didn't schedule the task before, so it caused an OOM here #24445
From the benchmark shown here, the performance of the cache will be downgraded if there are many keys.
Are you willing to submit a PR?