Unexpected predicate_property/2 size changing without editing predicate

For a test case which uses predicate_property/2 size argument the size will change after running make. but there was no change to the code. I am just wondering what could cause this, or if I look into why, what should I pay attention?

Note: The predicates are used with meta_predicate/1.

Example steps
Welcome to SWI-Prolog (threaded, 64 bits, version 8.3.8)

?- working_directory(_,'C:/Users/Groot/Documents').
true.

?- ['tests_25'].
true.

?- run_tests.
% PL-Unit: tests_25 ..... done
% All 5 tests passed
true.

?- make.
true.

?- run_tests.
% PL-Unit: tests_25 
ERROR: c:/users/groot/documents/tests_25.pl:23:
        test 1: assertion failed
        Assertion: 344==328
A
ERROR: c:/users/eric/documents/tests_25.pl:58:
        test 2: assertion failed
        Assertion: 504==472
A... done
% 2 assertions failed
% 2 tests failed
% 3 tests passed
false.

As the docs state

This includes the memory of the predicate header, the combined memory of all clauses including erased but not yet garbage collected clauses (see garbage_collect_clauses/0 and clause_property/2) and the memory used by clause indexes (see the indexed(Indexes) property. Excluded are lingering data structures. These are garbage data structures that have been detached from the predicate but cannot yet be reclaimed because they may be in use by some thread.

Re-loading code may lead to erased (old) code being counted as well. Anything running code may lead to new indexes. The purpose of this property is to be able to write tools that show a breakdown of the memory used by SWI-Prolog.

1 Like

Thanks.

I did read that (predicate_property/2 size) just before posting but could not relate what it means to what I am doing. So I will dissect the differences to learn more. :slightly_smiling_face:


EDIT

Tried using clause/2 to identify the code change but no joy.
Did find chainMetaPredicateSupervisor at the C source code level which uses MA_NEEDS_TRANSPARENT . (ref)