Description
Caught by Alex Chow in this Elasticsearch issue: https://github.com/elastic/elasticsearch/issues/13721
Today, PatternTokenizer reuses a single StringBuilder, but it doesn't free its heap usage after tokenizing is done. We can either stop reusing, or ask it to .trimToSize when we are done ...