This was a tricky question... but i wouldnt have slept if i couldnt figure out either... so i had to... Here is the reason:
Everytime you call rt.freeMemory(), the memory changes. coz the stack keeps getting assigned a new method call etc. etc. So the time when you call rt.freeMemory() in the if condition, the free memory is different from when you call it in the print statement. Actually, the free memory when you call in the if statement is never same, so it executes continuously and the free memory when you call it in the print statement is almost always same baring the first one or tow times, after this, its a recurring structure inside the same loop, so the structure never changes.
Hope i cleared you doubt... and if i didnt clear your doubt, run this code instead and see the output, you will understand, there is nothgin wrong going..