It looks like you are using an own implementation for random rotation and horizontal flip.
Could you post the code for these functions?
Also, let’s see if one of these functions are buggy, by applying them one by one:
image = RandomRotate(10)(image)
# check ram
image = RandomHorizontallyFlip()(image)
# check ram

The torchvision package provides these functions as well.
You can find them here 7 and here 2.