added memLimit argument with default 4095 (max in 32-bit windows)