Forum > General

heaptrc output meaning?

<< < (2/4) > >>

Martin_fr:

--- Quote from: hinst on April 20, 2014, 02:36:25 pm ---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?

--- End quote ---

AFAIK (but not 100% sure)
blocks allocated is how often a bock of mem was allocated.
   Alloc(10); Free(10); Alloc(10); Free(10); Alloc(10); Free(10); Alloc(10); Free(10);
would be 4 allocs size 40, and 4 frees size 40, yet they probably used the same memory.


Leledumbo:

--- Quote from: hinst on April 20, 2014, 02:57:25 pm ---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?

--- End quote ---
Sorry, I don't understand how you differ "memory application allocated" and "total memory usage reached" since both IMO are the same.

karaba:

--- Quote from: Leledumbo on April 20, 2014, 05:39:52 pm ---Sorry, I don't understand how you differ "memory application allocated" and "total memory usage reached" since both IMO are the same.

--- End quote ---

I assume he means that the memory manager can allocate more memory than the application has requested as a pre-fetch optimization, that means that the code has allocated 90M but the manager has already allocated 100M for future use.

hinst:
That is because I don't know what is better term to call these numbers


--- Quote from: Martin_fr on April 20, 2014, 04:56:41 pm ---   Alloc(10); Free(10); Alloc(10); Free(10); Alloc(10); Free(10); Alloc(10); Free(10);
would be 4 allocs size 40, and 4 frees size 40, yet they probably used the same memory.

--- End quote ---

Here peak is 10, while total is 40.

So I believe that hepatrc shows here total, not peak
  25513 memory blocks allocated : 51892490/51972360
  25511 memory blocks freed     : 51876066/51955936

I wonder what would happen if this internal memory counter overflows;
If I run a program like this

--- Code: ---while True do
  FreeMem(GetMem(1000));

--- End code ---
it should overflow sooner or later
the question is: when exactly? maybe it will take centuries

engkin:

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

--- End quote ---
The first number is the sum of memory requests in bytes.
The second number is the previous number rounded up to the nearest 8 bytes boundary, so always dividable by eight (bytes on 64 bit architecture)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version