New date & time formatter is not garbage free #4091
Replies: 1 comment
-
|
Hi @deepblueli, Thank you for the question. The formatter for the The main differences introduced in
The one-minute interval was chosen to strike a balance between the frequency of temporary object allocation and the complexity of handling daylight saving time transitions: we support all time zones, including those with offsets expressed as multiples of 15 minutes. If you are seeing temporary object allocation more frequently than once per minute, please open an issue and help debug the problem if possible. Otherwise, if the allocation frequency is not acceptable for your use case, there are two ways to improve it:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am running log4j2 in garbage free mode: https://logging.apache.org/log4j/2.x/manual/garbagefree.html
However, after upgraded to latest 2.25.4, I see garbage created by log4j that's not seen before, seems to be due to new date time formatter.
After I added system property -Dlog4j2.instantFormatter=legacy then it goes away.
If garbage is expected in new date time formatter, I would suggest to update garbagefree manual page to include this setting to use legacy date time formatter.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions