Updated code for force garbage collection as per CSH-401.