http://wiki.mikrotik.com/wiki/Limiting_a_user_to_a_given_amount_of_traffic_with_user_levels
This script when run i in regular intervals eats up memory. It seems like some bug with memory management. I hev it run every one hpour and in a bit more than 24 hours it occupied about 8 MB.
The only way to free memory is to reboot MT.