Skip to content

Don't cache Intl formatters built from long patterns, attributes, or symbols - #5043

Open
nicolas-grekas wants to merge 1 commit into
twigphp:3.xfrom
nicolas-grekas:intl-formatter-cache-size
Open

nicolas-grekas wants to merge 1 commit into
twigphp:3.xfrom
nicolas-grekas:intl-formatter-cache-size

Conversation

@nicolas-grekas

Copy link
Copy Markdown
Contributor

The formatter caches can contain up to 100 entries, but ICU stores the pattern of each date formatter in memory that memory_limit doesn't account for. Formatters with a cache key longer than 4 KB are now created on each call instead of being cached. This applies to long patterns, attributes and symbols.

#5037 changes the same method, so the PR merged second will need a rebase.

…symbols

The formatter caches hold at most 100 entries, but ICU keeps the pattern of each date formatter in memory that `memory_limit` doesn't account for. Formatters with a cache key longer than 4 KB are now created on each call instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants