Adding thread max memory use management.