Records can be referred to either by handle or by name. Whenever possible, handles should be used, because this naturally leads to robust, reentrant code, and avoids the danger of memory leaks. An anonymous record disappears when the system backtracks over its creation, when the record handle gets garbage collected, or when it is explicitly destroyed.
When named records are used, the visibility of the record name is local to the module where it was created. A named record never disappears, therefore, in order to free the associated memory, its contents should be erased when no longer needed.
?- record_create(R), record(R,a), record(R,b), recorded_list(R,L). L = [a,b] ?- record_create(R), ( member(X,[a,b,c]), record(R,X), fail ; recorded_list(R,L) ). L = [a,b,c]