We have a D2007 application, the memory capacity of which is steadily growing when working on Windows Server 2008 (x64, sp1).
It works fine on Windows Server 2003 (x32 or x64), XP, etc., where it goes up and down as expected.
We tried with the memory manager turned on or the latest FastMM4 4.92 with the same results.
Has anyone tried to control the memory usage of any Delphi application on Win2008 and would confirm?
Or do you have a key?
Precisions:
- there are no memory leaks in common sense (and yes, I am well acquainted with FastMM and others)
- memory was used using Process Explorer; both virtual memory (private bytes) and physical memory (WorkingSet Private) grow on Win2008
- memory consumption still increased even when there was memory pressure. (that we came to an investigation because it caused a crash, but only on Win2008)
Update : // ** repaced ** // the code is much simpler than our application, but it shows the same behavior.
Creating a list of 10,000,000 objects, and then 10,000,000 completed interfaces in 2 times, increases the used memory by ~ 60 MB and more than 300 MB by 100 additional executions in Windows Server 2008, but simply returns to where it was on XP .
If you run multiple instances, memory will not be released to allow other instances to run. Instead, the page file grows and the server scans ...
2: . QC 73347
, .
VCL . Process Explorer:
~ 2,6 5 ( ) ~ 118,6 .
116 5 .
const
CS_NUMBER = 10000000;
type
TCSArray = Array[1..CS_NUMBER] of TRTLCriticalSection;
PCSArray = ^TCSArray;
procedure TestStatic;
var
csArray: PCSArray;
idx: Integer;
begin
New(csArray);
for idx := 1 to length(csArray^) do
InitializeCriticalSection(csArray^[idx]);
for idx := 1 to length(csArray^) do
DeleteCriticalSection(csArray^[idx]);
Dispose(csArray);
end;
procedure TestDynamic(const Number: Integer);
var
csArray: array of TRTLCriticalSection;
idx: Integer;
begin
SetLength(csArray, Number);
for idx := Low(csArray) to High(csArray) do
InitializeCriticalSection(csArray[idx]);
for idx := Low(csArray) to High(csArray) do
DeleteCriticalSection(csArray[idx]);
end;
procedure TForm4.Button1Click(Sender: TObject);
begin
ReportMemoryLeaksOnShutdown := True;
TestStatic;
TestDynamic(CS_NUMBER);
end;