I've been searching through SO for awhile and all I can find is references to speed for strings and one or two rather misguided attempts at memory benchmarking.
My situation is that we have a ton of logging messages in our application and we're wondering if there is any measurable MEMORY advantage to using String.format vs. + vs. StringBuilder.
I've got a solid grip on measuring the time each of these is taking and there are plenty of SO posts for that.
Can anyone tell me which one is better for lowering memory consumption?
Example:
if(LOG.isDebugEnabled()) LOG.debug(String.format("Invoice id = %s is waiting for processing", invoice.getId()));
String.formatto see how it's injecting objects internally.