Tested on a clean 7.52:
//bset &binvar $calc(100*2^20) 65 | breplace &binvar 0 66 | hadd -bm table item1 &binvar | hadd -bm table item2 &binvar | echo -na => $hfind(table, /./, 1, r).data | hfree table
This makes mIRC jumps in memory usage from 10K to 700K, but after the script finishes, the memory usage only gets down to 200K.
After a while, doing nothing, the memory does get freed automatically at some point, but some weird things can be observed before that, executing a lot of $regex(a,a) definitely frees the memory.
//var %a 1000 | while (%a) { noop $regex(a, a) | dec %a }
500 was enough for me, but it varies.
Remove $hfind from the execution and nothing strange happens.
Of course if you do this repeatedly, mIRC comes up with a memory allocation error, so I don't think there should be any delay when freeing memory here.
Also, there is a report about $hfind here
https://forums.mirc.com/ubbthreads.php/topics/263124/ which has not been fixed, it does not seem to be an hard one to fix so I figured maybe it was forgotten, so I'm mentioning it here.