Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: Общие вопросы > MemChek vs FastMM


Автор: 2fank 14.3.2008, 13:03
Добрый день, столкнулся с проблемой утечек памяти, с помощью FastMM оптимизировал код, FastMM перестал "ругаться". Для надежности решил проверить MemCheck'om, и вот что получил в результате:

Код

MemCheck version 2.75

TOP 10 Leaks: begin
Leak #0 User allocated memory (GetMem)
    Size: 16
    1 Occurence
    call stack - 0 : (no debug info) Find error: 15F3F274
    call stack - 1 :  Routine @Sysutils@TMultiReadExclusiveWriteSynchronizer@BeginWrite Find error: 00412EA3
    call stack - 2 :  Routine @Forms@TCustomForm@Create Find error: 0047541D
    call stack - 3 :  Routine @Forms@TApplication@CreateForm Find error: 00480297
    call stack - 4 : (no debug info) Find error: 0051CE65
    call stack - 5 : (no debug info) Find error: 7C816D4B
    call stack - 6 : (no debug info) Find error: FFFFFFFC

TOP 10 Leaks: end

Total leak: 16 bytes


*** MEMCHK: Blocks STILL allocated ***

Leak #0 User allocated memory (GetMem)
    Size: 16
    1 Occurence
    call stack - 0 : (no debug info) Find error: 15F3F274
    call stack - 1 :  Routine @Sysutils@TMultiReadExclusiveWriteSynchronizer@BeginWrite Find error: 00412EA3
    call stack - 2 :  Routine @Forms@TCustomForm@Create Find error: 0047541D
    call stack - 3 :  Routine @Forms@TApplication@CreateForm Find error: 00480297
    call stack - 4 : (no debug info) Find error: 0051CE65
    call stack - 5 : (no debug info) Find error: 7C816D4B
    call stack - 6 : (no debug info) Find error: FFFFFFFC

*** MEMCHK: End of allocated blocks ***


*** MEMCHK: Chronological leak information ***

* User allocated memory (GetMem) (Leak #0) Size: 16

*** MEMCHK: End of chronological leak information ***


*** MEMCHK: Blocks written to after destruction ***

    Bad blocks count: 0


*** MEMCHK: End of blocks written to after destruction ***


код DPR
Код

program ToTools;

uses
  MemCheck in 'units\MemCheck.pas',
  //FastMM4 in 'Components\FastMM478\FastMM4.pas',
  Forms,
  main in 'forms\main.pas' {frmMain},
  viewApp in 'forms\viewApp.pas' {frmViewApp},
  LogException in 'forms\LogException.pas' {frmException},
  settings in 'forms\settings.pas' {frmSettings};

{$R *.res}

begin
  MemChk;
  Application.Initialize;
  Application.CreateForm(TfrmMain, frmMain);
  Application.Run;
end.


Подскажите, а кому верить? smile 

Автор: Alexeis 16.3.2008, 13:50
2fank, думаю стоит поставить галочку Use Debug DCU чтобы точнее локализовать место утечки. В текущем виде имена 3х функций не видны. 

Автор: 2fank 16.3.2008, 16:24
Поставил "Use Debug DCU", сделал проекту Build
Результат тот же :(

Код

MemCheck version 2.75

TOP 10 Leaks: begin
Leak #0 User allocated memory (GetMem)
    Size: 16
    1 Occurence
    call stack - 0 : (no debug info) Find error: 0D5BF274
    call stack - 1 : (no debug info) Find error: 00412F53
    call stack - 2 : (no debug info) Find error: 0047570D
    call stack - 3 : (no debug info) Find error: 00480587
    call stack - 4 : (no debug info) Find error: 0051FE65
    call stack - 5 : (no debug info) Find error: 7C816FD3
    call stack - 6 : (no debug info) Find error: FFFFFFFC

TOP 10 Leaks: end

Total leak: 16 bytes


*** MEMCHK: Blocks STILL allocated ***

Leak #0 User allocated memory (GetMem)
    Size: 16
    1 Occurence
    call stack - 0 : (no debug info) Find error: 0D5BF274
    call stack - 1 : (no debug info) Find error: 00412F53
    call stack - 2 : (no debug info) Find error: 0047570D
    call stack - 3 : (no debug info) Find error: 00480587
    call stack - 4 : (no debug info) Find error: 0051FE65
    call stack - 5 : (no debug info) Find error: 7C816FD3
    call stack - 6 : (no debug info) Find error: FFFFFFFC

*** MEMCHK: End of allocated blocks ***


*** MEMCHK: Chronological leak information ***

* User allocated memory (GetMem) (Leak #0) Size: 16

*** MEMCHK: End of chronological leak information ***


*** MEMCHK: Blocks written to after destruction ***

    Bad blocks count: 0


*** MEMCHK: End of blocks written to after destruction ***



Автор: Alexeis 16.3.2008, 16:43
Не тот же а намного хуже. Вообще нет Debug Info.

Автор: 2fank 16.3.2008, 17:08
Alexeis, Подскажи, как быть?

Автор: ShadeSt 18.3.2008, 10:08
При компиляции проекта надо поставить галку "Include TD32 Debug Info" на вкладке "Linker",
 тогда memCheck будет выдавать нормальную информацию.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)