[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference irocz::common_brouters

Title:Digital Brouters Conference
Notice:New common-code brouter family: RouteAbout, DECswitch 900
Moderator:MARVIN::HARTLL
Created:Mon Jul 17 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:929
Total number of notes:3736

928.0. "memory sizes reported by 90EI..." by nacad.dechub.lkg.dec.com::BARENYS (John Barenys) Thu Jun 05 1997 20:29

Hi all... I had a call about this from a customer and have now also 
been perplexed by it:

at the main promt level:

*mem
Number of bytes:  Busy = 14408,  Idle = 2832,  Free = 1962915

and then under talk 5:

*talk 5

+mem
                  Total  Reserve    Never     Perm     Temp     Prev
                                    Alloc    Alloc    Alloc    Alloc
Heap memory     3390987        0  1952135  1410832    25700     2320

Number of global buffers: Total = 400, Free = 400, Fair = 311, Low = 80
Global buff size: Data = 2176, Hdr = 22, Wrap = 62, Trail = 12, Total = 2272



now, there seems to be a discrepancy between the two... can some one help
me out with what I am seeing.  I know that the router has 4MB of FLASH
and 4MB of DRAM, but none of the numbers even come close.

The router is pretty much totally unconfigured and is not on a live
network (the only thing attached is the console).


Thanks,
	-John B.


Product: RouteAbout Access EI
Diags rev: 2.97
Functional: 2-03

T.RTitleUserPersonal
Name
DateLines
928.1Memory variables descriptionMARVIN::HARTTony Hart, InterNetworking Prod. Eng. GroupFri Jun 06 1997 09:2569
There are two types of memory allocation request in the DRS code, one allocates memory
permanently (i.e. that memory will never be free'd) and the other allocates memory
temporarily (i.e. the memory may be free'd sometime in the future).  Both types of
allocation come out of the same contiguious heap.    When memory is free'd it isn't
returned to the heap instead its put on a list (several lists actually based on its
size), the temporary memory allocator first attempts to satisfy a request from this
list before allocating it from heap. 

The following variables are used to keep track of the heap, I need to describe them
here to make the numbers below make sense.

	LOMEM	- Address of first byte of heap memory
	TPMEM	- Address of last byte of heap memory
	BTMEM 	- Address of first byte of unallocated heap.  This variable starts out
		  equal to LOMEM and as heap is allocated to grows towards TPMEM.  This
		  variable *never* decrements (since memory is never returned to heap,
		  free'd memory being kept on the lookaside lists).
	FRMEM	- Count of the number of bytes of heap that are free.  This value is
		  decremented each time memory is allocated from the heap, it never
		  increments.
	PRMEM	- Count of the number of bytes of heap which have been allocated by the
		  permanent memory allocator.  This value never decrements.


OK so what do the numbers represent ...

>*mem
>Number of bytes:  Busy = 14408,  Idle = 2832,  Free = 1962915

	Idle =  number of bytes referenced by the lookaside lists.  So this represents
		memory that was allocated from the heap by the temporary memory
		allocator and has subsequently been returned to pool and is available
		for re-allocation as temporary memory.   This is calculated by adding
		up all the memory blocks in the lookaside list.

	Busy =  number of bytes of heap in currently in use.
		This is calculated as "((BTMEM - LOMEM) - Idle) - PRMEM"

	Free = 	number of bytes left in heap.  This is the same as the number of bytes
	 	of heap which have never been allocated.  This is simply the FRMEM variable.


>+mem
>                  Total  Reserve    Never     Perm     Temp     Prev
>                                    Alloc    Alloc    Alloc    Alloc
>Heap memory     3390987        0  1952135  1410832    25700     2320

	Total =	size of heap.  This is calculated as (TPMEM - LOMEM).

	Reserve = bytes of heap which are not available to the memory allocators
		  (for various reasons).
	
	Never =	same as "Free" (i.e. FRMEM)
	
	Perm =	number of bytes allocated by the permanently memory allocator
		This is simply the current value of PRMEM.

	Temp =	same as "Busy"

	Prev =	same as "Idle"


So if you add Never+Perm+Temp+Prev you should get Total.
Buffer memory is either allocated from heap or separately (depending on the platform) in this
case its allocated from heap.  So the total amount of heap is 3390987 bytes or 3.23Mb.  The
rest of DRAM is taken up with things like static data and stacks.  In this case code executes
from Flash memory.

928.2reformatted for 80 colsEDWIN::TACFri Jun 06 1997 12:4781
           <<< IROCZ::USER4:[NOTES$LIBRARY]COMMON_BROUTERS.NOTE;1 >>>
                        -< Digital Brouters Conference >-
================================================================================
Note 928.1              memory sizes reported by 90EI...                  1 of 1
MARVIN::HART "Tony Hart, InterNetworking Prod. Eng." 69 lines   6-JUN-1997 05:25
                       -< Memory variables description >-
--------------------------------------------------------------------------------

There are two types of memory allocation request in the DRS code, one allocates
memory permanently (i.e. that memory will never be free'd) and the other
allocates memory temporarily (i.e. the memory may be free'd sometime in the
future).  Both types of allocation come out of the same contiguious heap.   
When memory is free'd it isn't returned to the heap instead its put on a list
(several lists actually based on its size), the temporary memory allocator first
attempts to satisfy a request from this list before allocating it from heap. 

The following variables are used to keep track of the heap, I need to describe
them here to make the numbers below make sense.

	LOMEM	- Address of first byte of heap memory
	TPMEM	- Address of last byte of heap memory
	BTMEM 	- Address of first byte of unallocated heap.  This variable
                  starts out equal to LOMEM and as heap is allocated to grows
                  towards TPMEM.  This variable *never* decrements (since
                  memory is never returned to heap, free'd memory being kept
                  on the lookaside lists).
	FRMEM	- Count of the number of bytes of heap that are free.  This
                  value is decremented each time memory is allocated from the
                  heap, it never increments.
	PRMEM	- Count of the number of bytes of heap which have been
                  allocated by the permanent memory allocator.  This value
                  never decrements.


OK so what do the numbers represent ...

>*mem
>Number of bytes:  Busy = 14408,  Idle = 2832,  Free = 1962915

	Idle =  number of bytes referenced by the lookaside lists.  So this
                represents memory that was allocated from the heap by the
                temporary memory allocator and has subsequently been returned
                to pool and is available for re-allocation as temporary memory.
                This is calculated by adding up all the memory blocks in the
                lookaside list.

	Busy =  number of bytes of heap in currently in use.
		This is calculated as "((BTMEM - LOMEM) - Idle) - PRMEM"

	Free = 	number of bytes left in heap.  This is the same as the number
                of bytes of heap which have never been allocated.  This is
                simply the FRMEM variable.


>+mem
>                  Total  Reserve    Never     Perm     Temp     Prev
>                                    Alloc    Alloc    Alloc    Alloc
>Heap memory     3390987        0  1952135  1410832    25700     2320

	Total =	size of heap.  This is calculated as (TPMEM - LOMEM).

	Reserve = bytes of heap which are not available to the memory allocators
		  (for various reasons).
	
	Never =	same as "Free" (i.e. FRMEM)
	
	Perm =	number of bytes allocated by the permanently memory allocator
		This is simply the current value of PRMEM.

	Temp =	same as "Busy"

	Prev =	same as "Idle"


So if you add Never+Perm+Temp+Prev you should get Total.
Buffer memory is either allocated from heap or separately (depending on the
platform) in this case its allocated from heap.  So the total amount of heap is
3390987 bytes or 3.23Mb.  The rest of DRAM is taken up with things like static
data and stacks.  In this case code executes from Flash memory.


928.3thanks for the quick replyNETCAD::BARENYSJohn BarenysFri Jun 06 1997 13:115
Tony,
	Thanks for that reply.  Quite in 
depth... excactly what I was looking for.

-John B.