andremussche / scalemm

Fast scaling memory manager for Delphi
https://code.google.com/p/scalemm/
Other
98 stars 22 forks source link

Loading more than 20Gb of RAM #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open a new console application
2. Define Mat: Array of Array of Double;
3. SetLength(Mat, 100000000, 20)

What is the expected output? What do you see instead?
Program should load a little over 20Gb of RAM memory. It takes a couple seconds 
to load more than 20Gb on other MM. However, on ScaleMM, after reaching around 
20Gb, loading additional memory becomes incredibly slow (~1 additional Mb per 
second).

What version of the product are you using? On what operating system?
2.2

Please provide any additional information below.
I am running Delphi XE2, Win64, on a Dell Workstation (Intel Xeon, 12 cores, 
128Gb internal RAM).

Original issue reported on code.google.com by tf.ran...@gmail.com on 17 Oct 2013 at 9:16

GoogleCodeExporter commented 9 years ago
Superb MM! The best available!

Original comment by tf.ran...@gmail.com on 17 Oct 2013 at 9:18

GoogleCodeExporter commented 9 years ago
alright, the problem is I don't have a pc with more than 20gb of ram :)
but the array loads fine and fast? and after that is gets slow? or is it slow 
when it almost has loaded the full array?

can you take some screenshots with process explorer (double click on your test 
program and switch to "performance graph" when it is slow?

and maybe also the threads tab and double click on main thread so I can see the 
stack?

Original comment by andre.mussche on 19 Oct 2013 at 6:58

GoogleCodeExporter commented 9 years ago
quick workaround (will be fixed in next release):

function TMediumThreadManager.GetMem(aSize: NativeUInt): Pointer;
var
  loopcount: Integer;

...

  pheader   := FFreeMem[iMSB];
  if (pheader <> nil) then
  begin
    loopcount := 0;
    //check all sizes
    repeat
      if (pheader.Size >= allocsize) then
      begin
        iFreeMemIndex := iMSB;
        Break;
      end;
      inc(loopcount);
      if loopcount > 100 then  //no endless scan, can make it slower and slower...
      begin
        pheader := nil;
        Break;
      end;
      pheader := pheader.NextFreeItem;
    until pheader = nil;
  end;

...

Original comment by andre.mussche on 21 Oct 2013 at 1:37