Large Arrays and GC
Robert Jacques
sandford at jhu.edu
Fri May 9 08:14:40 PDT 2008
dsimcha and I debugged this last night. It appears it’s a case of the
"partly conservative" collector problem.
( http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Precise_vs._conservative_and_internal_pointers
). Essentially, there are values on the stack (including the array’s own
length parameter) which when interpreted as a pointer, point to the array.
And the bigger the array, the bigger the target and the more likely at
least one pointer’s found. The issue were it works but uses too much
memory, seems to be a case of some allocations ‘sticking’ before the GC
finds some clear ranges, which it uses thereafter.
More information about the Digitalmars-d
mailing list