andremussche / scalemm

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

ScaleMM2 doesn't work with Intraweb projects #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a new empty Intraweb project using default options
2.Include ScaleMM2 as the first unit in your .DPR file
3.Build and run the application

There will be an Assert error:

Debugger Exception Notification
Project Project1.exe raised exception class EAssertionFailed with message 
'Assertion failure (...\smmGlobal.pas, line 264)'.

Extracted from smmGlobal.pas:

procedure TGlobalMemManager.FreeMediumBlockMemory(
  aBlockMem: PMediumBlockMemory);
var
  firstmem: PMediumHeader;
begin
  //keep max 10 blocks in buffer
  //if FFreeBlockCount >= 10 then
  begin
    firstmem := PMediumHeader( NativeUInt(aBlockMem) + SizeOf(TMediumBlockMemory));
    //is free mem?
    //if NativeUInt(firstmem.NextMem) > NativeUInt(1 shl 31) then
    if firstmem.Size and 1 <> 0 then
    begin
      //fully free mem? we can only release fully free mem (duh...)
      if PMediumHeaderExt(firstmem).ArrayPosition = 16 then
      begin
        //RELEASE TO WINDOWS
        VirtualFree(aBlockMem, 0 {all}, MEM_RELEASE);
        //exit!
        Exit;
      end;
    end;
    Assert(False);  <--- ERROR HERE
  end;

Using latest version from ScaleMM2 + BDS2006 + IW10 under WindowsXP SP3

Original issue reported on code.google.com by alex7...@gmail.com on 6 Oct 2011 at 1:47

GoogleCodeExporter commented 9 years ago
ScaleMM2 has some flaws, which cannot be fixed (easily)

try ScaleMM3 instead:
http://code.google.com/p/scalemm/source/browse/#svn%2Ftrunk

(note: use "raw file" to download code in webbrowser)

Original comment by andre.mussche on 7 Oct 2011 at 10:28

GoogleCodeExporter commented 9 years ago
Because of my investigation of available MM's (see result: 
http://delphitools.info/2011/10/13/memory-manager-investigations/)
I gave it another try.

Thanks to your test with Intraweb I was able to find some problems! 
(just because it did some other memory calls, so problems where early visible, 
which is easier to debug/test).

I will do some cleanup and post the results soon

Original comment by andre.mussche on 27 Oct 2011 at 6:35

GoogleCodeExporter commented 9 years ago
Hi!

I'm glad that I could help with a small thing! :-)

Looking forward to see your new MM in action!

Original comment by alex7...@gmail.com on 28 Oct 2011 at 5:46

GoogleCodeExporter commented 9 years ago
see the version2 branch for a new version

Original comment by andre.mussche on 7 Mar 2012 at 7:49