To remove all of the currently unused modules from memory, run modunload(1M) with a module ID of 0:
# modunload -i 0