You talking about

    //Get memory limit. Workunit specified value takes precedence over config file
    int memLimitMB = globals->getPropInt("defaultMemoryLimitMB", DEFAULT_MEM_LIMIT);
    memLimitMB = queryWorkUnit()->getDebugValueInt("hthorMemoryLimit", memLimitMB);


?
It's ok to let the command line override the other possible places, but should not be the ONLY way to set it.

(though I think the memLimitMB should read from the agentTopology too, as well as the WU and the command line)