Note that anonymous stores (which are referred to by handle rather than name) are automatically erased and destroyed when their handle gets garbage collected, or when failing across their creation point.
On the other hand, named stores should be explicitly erased, otherwise their contents will continue to occupy memory.
Calling store_erase/1 is equivalent to deleting every entry in the store via store_delete/2.
Note: If StoreHandle is not a handle, then it must be an atom or a compound term, and the store is identified by this term's toplevel functor together with the context module. .
?- store_create(Handle), store_set(Handle, key, value), stored_keys_and_values(Handle, Data1), store_count(Handle, N1), store_erase(Handle), stored_keys_and_values(Handle, Data2), store_count(Handle, N2). Handle = $&(store,"17h3") Data1 = [key - value] N1 = 1 Data2 = [] N2 = 0 Yes (0.00s cpu)