Good lord, this long-winded writing style is maddening to read!
Here's what he changed:
> Set<Thing> aSet = new HashSet<Thing>();
to:
> Set<Thing> aSet = new HashSet<Thing>(0);
His explanation:
"Most of these sets were empty for the entirety of their life, but each one was consuming enough memory to hold the default number of entries. Huge numbers of these empty sets were created and together they consumed over half a gigabyte of memory. Over a third of our available heap."
I'm not sure he ever got around to explaining how it saved "half a million dollars", though.
Here's what he changed:
> Set<Thing> aSet = new HashSet<Thing>();
to:
> Set<Thing> aSet = new HashSet<Thing>(0);
His explanation:
"Most of these sets were empty for the entirety of their life, but each one was consuming enough memory to hold the default number of entries. Huge numbers of these empty sets were created and together they consumed over half a gigabyte of memory. Over a third of our available heap."
I'm not sure he ever got around to explaining how it saved "half a million dollars", though.