System handling of undef_method

When a method is undefined, does the code hang around as orphaned code, or is it garbage collected and totally removed, or some other action performed?
I am interested in the case of many methods being added for limited (possibly once only) use and the effect on code size and performance.
Paul F Fraser