develop environment
IDE: D7
remobject: 8.3.91.1167,
system: win 7
I have see the same problem on remobject’s talk , if client get very big data from server by TDAMemDataTable. the server will raise an Exception. I debug the server’s program. the debug of "out of memory " is from this function TROBinaryMemoryStream.Realloc(var NewCapacity: Longint): Pointer;
{$ENDIF}
const
MemoryDelta = $2000; { Must be a power of 2 }
begin
if (FCapacityIncrement <> 0) and (NewCapacity<>0) then inc(NewCapacity,FCapacityIncrement);
{$IFDEF PATCH_MEMORYSTREAM_REALLOC}
if (NewCapacity > 0) and (NewCapacity <> Position) then
NewCapacity := (NewCapacity + (MemoryDelta - 1)) and not (MemoryDelta - 1);
Result := Memory;
if NewCapacity <> Capacity then
begin
if NewCapacity = 0 then
begin
FreeMem(Memory);
Result := nil;
end else
begin
if Capacity = 0 then
GetMem(Result, NewCapacity)
else
ReallocMem(Result, NewCapacity); — exception is raised here
if Result = nil then raise EStreamError.CreateRes(@SMemoryStreamError);
end;
end;
{$ELSE}
Result := inherited Realloc(NewCapacity);
{$ENDIF}
end;
the caption of exception is " class EOutOfMemory with message ‘Out of memory’. Process stopped. Use Step or Run to continue."
so I Create simple Code like this
procedure TForm1.Button1Click(Sender: TObject);
begin
var
P: Pointer;
i: Integer;
begin
I := High(Integer);
P := GetMemory(I);
ReallocMem(P, I) ;
FreeMem§;
end;
the program will raise the same exception , so i think this exception is raised by delphi , but i don’t know how to solve this problem.