I'm using Delphi 10.1 and Windows 10, with all current updates.
My application uses and re-uses a large number of dynamic arrays, 50 or more, each having up to 5,000 elements. During execution, these arrays are cleared using either SetLength(thearray,0)
or thearray:=nil
. Immediately following this, a new size is assigned with SetLength(thearry,newsize)
.
For most of the arrays, this works smoothly. But occasionally, one or another of these allocations (the same one every time the program runs) crashes without an exception or other notice. The crash can occur on either the clear function or on the sizing function. The program has to be closed using Program Manager and then restarted.
The really odd thing is that the array causing the crash can change depending on the memory manager employed -- native Delphi, ScaleMM2, FastMM4. In the past, I've sometimes solved the problem by renaming arrays, but the problem pops back up from time to time after multiple changes and recompiles.
The machine's RAM checks out fine, and the problem persists on multiple machines.