> > In scenarios where the method is called at high frequency is it possible > that the extra memory allocation to create copies and the consequential > GC burden to free them up again offset any benefit gained by removing > the synchronization? >
Well, it depends. setMetaData already creates a new array if a key is not yet associated with a value. So it might increase GC stress only if you overwrite an existing value at high frequency On Fri, Sep 2, 2022 at 1:55 PM Chris Colman <chr...@stepaheadsoftware.com.invalid> wrote: > On 2/09/2022 7:59 pm, Andrea Del Bene wrote: > > In addition I think setMetaData should always return a new copy of > Application#metadata to > > ensure a proper synchronization among threads, but I'm not 100% sure > about this. > > In scenarios where the method is called at high frequency is it possible > that the extra memory allocation to create copies and the consequential > GC burden to free them up again offset any benefit gained by removing > the synchronization? > > > > -- Andrea Del Bene. Apache Wicket committer.