Forum > General

heaptrc output meaning?

(1/4) > >>

hinst:
What do these numbers mean?

Heap dump by heaptrc unit
25513 memory blocks allocated : 51892490/51972360
25511 memory blocks freed     : 51876066/51955936
2 unfreed memory blocks : 16424
True heap size : 2359296
True free heap : 2359296
Should be : 2342616

jwdietrich:
The meaning of the output is that your application has at least one memory leak. 25513 memory blocks were allocated, but only 25511 blocks have been freed after your program exits. You should check your code to find out which block was allocated but not released.

hinst:
And what about these numbers?

--- Quote from: hinst on April 20, 2014, 01:35:49 pm ---25513 memory blocks allocated : 51892490/51972360
25511 memory blocks freed     : 51876066/51955936

--- End quote ---
I often stare at them but do not understand what they mean. Is it 51 Mega Bytes? Where? When? Why?

Leledumbo:
From the source:

--- Code: ---procedure dumpheap;
var
  pp : pheap_mem_info;
  i : ptrint;
  ExpectedHeapFree : ptruint;
  status : TFPCHeapStatus;
  ptext : ^text;
  loc_info: pheap_info;
begin
  loc_info:=@heap_info;
  if useownfile then
    ptext:=@ownfile
  else
    ptext:=@stderr;
  pp:=loc_info^.heap_mem_root;
  Writeln(ptext^,'Heap dump by heaptrc unit');
  Writeln(ptext^,loc_info^.getmem_cnt, ' memory blocks allocated : ',
    loc_info^.getmem_size,'/',loc_info^.getmem8_size);
  Writeln(ptext^,loc_info^.freemem_cnt,' memory blocks freed     : ',
    loc_info^.freemem_size,'/',loc_info^.freemem8_size);
  Writeln(ptext^,loc_info^.getmem_cnt-loc_info^.freemem_cnt,
    ' unfreed memory blocks : ',loc_info^.getmem_size-loc_info^.freemem_size);
...
--- End code ---
Can you guess? ;)

hinst:
So it shows how much memory application allocated, but it does not mean that total memory usage reached this number at any specific point of time?

Navigation

[0] Message Index

[#] Next page

Go to full version