# Module unload/delete

**URL:** <https://swi-prolog.discourse.group/t/module-unload-delete/7222>\
**Category:** PlDoc\
**Tags:** how-to\
**Created:** [February 5, 2024, 4:38pm UTC](https://swi-prolog.discourse.group/t/module-unload-delete/7222 "2024-02-05T16:38:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [February 5, 2024, 6:56pm UTC](https://swi-prolog.discourse.group/t/module-unload-delete/7222/2 "2024-02-05T18:56:17Z")

</div>

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](https://swi-prolog.discourse.group/t/re-defining-a-predicate-in-a-new-module-file-vs-in-a-traditional-file/3491/1)

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](https://www.swi-prolog.org/pldoc/doc/_SWI_/library/modules.pl)

---

_[View the full topic](https://swi-prolog.discourse.group/t/module-unload-delete/7222)._
