Hardware and performance

New for tuning: CFG->apachemaxmem for controlling memory footprint