fix the amount to be reserved

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>
add function to get remaining memory byte count

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>
avoid having too many concurrent requests if available memory is low

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>