ToTheMetal
Programmer
The problem is in a purchased control and the original developer is no longer to be found.
The basic problem is the following code from the control:
When [tt]NewCapacity[/tt] is 128256 I get "project mte1_4.exe raised exception class EOutOfMemory with message 'Out of memory'. Process stopped. Use Step or Run to continue." when running in the Delphi 7 IDE.
I have tons of physical and virtual memory available according to Windows, so I don't know why I am getting this error. I researched everything I could find about heap and stack limitations and found nothing useful yet.
Here are some more details that might help:
[ol]
[li]The allocation increment is 128 items, which translates into 128 * 3 * sizeof(Double) = 128 * 24 = 512 bytes.[/li]
[li][tt]FCount[/tt] is 128128 and [tt]NewCapacity[/tt] is 128256 when the error occurs.[/li]
[li][tt]MaxVertexListSize[/tt] is 268435454[/li]
[li]The process is using 35,604K of memory when the error occurs, according to the Windows Task Manager.[/li]
[li]523244 Physical memory total, 131872 Physical memory available when the error occurs, according to Windows Task Manager.[/li]
[/ol]
Any suggestions or constructive criticisms are welcome and no offense will be taken if I am overlooking something obvious!
-Doug
The basic problem is the following code from the control:
Code:
procedure TPline.SetCapacity(NewCapacity: Integer);
begin
if (NewCapacity < FCount) or (NewCapacity > MaxVertexListSize) then
Error('TPline.SetCapacity: Index out of bounds');
if NewCapacity <> FCapacity then
begin
ReallocMem(FData, NewCapacity*FDimension*SizeOf(Double));
FCapacity := NewCapacity;
end;
end;
When [tt]NewCapacity[/tt] is 128256 I get "project mte1_4.exe raised exception class EOutOfMemory with message 'Out of memory'. Process stopped. Use Step or Run to continue." when running in the Delphi 7 IDE.
I have tons of physical and virtual memory available according to Windows, so I don't know why I am getting this error. I researched everything I could find about heap and stack limitations and found nothing useful yet.
Here are some more details that might help:
[ol]
[li]The allocation increment is 128 items, which translates into 128 * 3 * sizeof(Double) = 128 * 24 = 512 bytes.[/li]
[li][tt]FCount[/tt] is 128128 and [tt]NewCapacity[/tt] is 128256 when the error occurs.[/li]
[li][tt]MaxVertexListSize[/tt] is 268435454[/li]
[li]The process is using 35,604K of memory when the error occurs, according to the Windows Task Manager.[/li]
[li]523244 Physical memory total, 131872 Physical memory available when the error occurs, according to Windows Task Manager.[/li]
[/ol]
Any suggestions or constructive criticisms are welcome and no offense will be taken if I am overlooking something obvious!
-Doug