Root File Size not decreasing after deleting its directory and contents inside it

Dear Experts,
I have a large root file for my analysis, I needed to delete some directories and their contents which i did using
TFile *InputFile = new TFile(“input.root”,“UPDATE”);
dir = (TDirectory *)InputFile->Get(“myDir”);
dir->DeleteAll();
InputFile->rmdir(“myDir”);
InputFile->Close();

It deleted the directories but the file size is still same as original, I tried checking the InputFile->Map() command
There are gaps in memory. I want to know how to decrease the size of file.
Thanks

Hi,

maybe this will work: Rootrm: size of file unchanged - #6 by yus