Module unload/delete

This is one thread that seems to try and answer your question: Re-defining a predicate in a new module file, vs. in a traditional file

The short answer seems to be, no, you cannot truly unload a module. But there seem to be workarounds depending on the use case?

What is in your large module? If it is data, you could probably read the file and assert its contents; then retract them when you no longer need it. This will get garbage collected.

Apparently there is also in_temporary_module/3 here: modules.pl -- Module utility predicates

1 Like