[Close of connections][memory] added max on memory usage