ThreadLocal variables are useful when we want to have a thread safe instance and we don’t want to use synchronization as the performance cost with synchronization is more. One such case is when SimpleDateFormat is used OR when we have a requirement to associate state with a thread, then also ThreadLocal can be used.
But when running it with Zing before version ZVM 18.12, you may observe some performance issues due to the concurrent nature of the collector. If you face any performance issues, you can add the following parameter -XX:+UseModifiedThreadLocal to the JVM options and rerun the application. Make sure to test the application properly. Since ZVM 18.12 this setting is the default.