Comment 4 for bug 784978

Updated patch with configurable memory limit as suggested by Ruslan.