Running for Free Memory
by in CodeSOD on 2013-06-25Jon checked the source control system and discovered a recent check-in by a new-hire touched nearly every file. The check-in comment read, “Performance enhancements; reduced memory usage.”
Runtime runny = Runtime.getRuntime(); runny.freeMemory(); //performance /* Add the allocation level information */ TxnMaker tm = new TxnMaker(txnId, buySell, rate, taxFlag, isForeign, map); xmlMessage.getTxns().addAll(tm.getTxns()); runny.freeMemory(); //performance Log.writeTrace("Txns built"); TxnGroupMaker gm = new TxnGroupMaker(txnId, buySell, rate, spanishTaxFlag, isForeign, map); Log.writeTrace("Txn Groups Built"); gm.smoothAllEconomicFields(tm.getAllocations(), map, isForeign); xmlMessage.getTxnGroups().addAll(gm.getTxnGroups()); runny.freeMemory(); //performance