Server memory usage was seen to increase without bound while running certain SQL queries. The problem was due to allocating a range, ALCRNG(), and then closing the file without freeing the range, FRERNG(). The logic has been modified to ensure that all allocated ranges are freed when the file is closed.