Remy Porter

Computers were a mistake, which is why I'm trying to shoot them into space. Editor-in-Chief for TDWTF.

Jun 2013

Running for Free Memory

by in CodeSOD on

Jon 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

Where We're Going, We Don't Need Tables

by in Best of the Sidebar on

The Oracle database doesn’t allow you to execute a SELECT statement without a FROM clause. You can't, for example, do SELECT 2 + 2, you must do SELECT 2 + 2 FROM dual. “dual” is a fictional table which exists solely to allow these sorts of operations.

What it isn’t meant for is Aspirist’s sample, from the Sidebar.