Network Component  Version 7.11.0
MDK Middleware for IPv4 and IPv6 Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NetMEM: Memory Management

Events generated by the Network - Memory Management functions. More...

Functions

__STATIC_INLINE void EvrNetMEM_InitMemory (uint32_t pool_size, uint32_t limit0, uint32_t limit1)
 Event on initialize memory management (Op) More...
 
__STATIC_INLINE void EvrNetMEM_AllocMemory (uint32_t size, uint32_t used, uint32_t blocks)
 Event on request to allocate memory (Op) More...
 
__STATIC_INLINE void EvrNetMEM_AllocLimitExceeded (uint32_t size, uint32_t used, uint32_t blocks)
 Event on memory allocation limit exceeded (Op) More...
 
__STATIC_INLINE void EvrNetMEM_AllocOutOfMemory (uint32_t size, uint32_t used, uint32_t blocks)
 Event on out of memory error (Error) More...
 
__STATIC_INLINE void EvrNetMEM_ShrinkMemory (uint32_t new_size, uint32_t old_size)
 Event on shrink memory block request (Op) More...
 
__STATIC_INLINE void EvrNetMEM_FreeMemory (uint32_t size, uint32_t used, uint32_t blocks)
 Event on request to free memory (Op) More...
 
__STATIC_INLINE void EvrNetMEM_FreeInvalidBlock (uint32_t size)
 Event on attempt to free an invalid memory (Error) More...
 
__STATIC_INLINE void EvrNetMEM_FreeLinkCorrupted (uint32_t size)
 Event on corrupted internal memory link (Error) More...
 
__STATIC_INLINE void EvrNetMEM_UninitMemory (void)
 Event on de-initialize memory management (Op) More...
 

Description

Events generated by the Network - Memory Management functions.

The Network Memory Management functions generate events that inform about the dynamic memory management events and help in troubleshooting.

Function Documentation

__STATIC_INLINE void EvrNetMEM_AllocLimitExceeded ( uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on memory allocation limit exceeded (Op)

Parameters
sizerequested memory size in bytes
usedused memory status in bytes
blocksnumber of used blocks status

The event AllocMemory is created when the Network Component failed to allocate memory due to exceeded threshold level limit_0. This is not critical failure and the system will try to allocate memory again.

Value in the Event Recorder shows:

  • size: requested size of the memory block to allocate in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes.
  • blocks: number of allocated memory blocks.
__STATIC_INLINE void EvrNetMEM_AllocMemory ( uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on request to allocate memory (Op)

Parameters
sizerequested memory size in bytes
usedused memory status in bytes
blocksnumber of used blocks status

The event AllocMemory is created when the Network Component attempts to allocate memory.

Value in the Event Recorder shows:

  • size: requested size of the memory block to allocate in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes.
  • blocks: number of allocated memory blocks.
__STATIC_INLINE void EvrNetMEM_AllocOutOfMemory ( uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on out of memory error (Error)

Parameters
sizerequested memory size in bytes
usedused memory status in bytes
blocksnumber of used blocks status

The event AllocOutOfMemory is created when the Network Component failed to allocate memory because the available memory is exhausted.

Value in the Event Recorder shows:

  • size: requested size of the memory block to allocate in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes.
  • blocks: number of allocated memory blocks.
Note
The size of allocated space (used) is smaller than the size of the memory pool (pool_size), because additional memory is needed internally for handling memory blocks.
__STATIC_INLINE void EvrNetMEM_FreeInvalidBlock ( uint32_t  size)

Event on attempt to free an invalid memory (Error)

Parameters
sizesize of the memory block to free

The event FreeInvalidBlock is created when the Network Component attempts to release invalid memory.

Value in the Event Recorder shows:

  • size: size of the memory block to release in bytes.
__STATIC_INLINE void EvrNetMEM_FreeLinkCorrupted ( uint32_t  size)

Event on corrupted internal memory link (Error)

Parameters
sizesize of the memory block to free

The event FreeLinkCorrupted is created when the Network Component detects failure in internal memory handling, when trying to release a memory block. This is a fatal error, which happens when the memory is overwritten or when the application writes before or after the end of buffer.

Value in the Event Recorder shows:

  • size: size of the memory block to release in bytes.
__STATIC_INLINE void EvrNetMEM_FreeMemory ( uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on request to free memory (Op)

Parameters
sizesize of the memory block to free
usedused memory status in bytes
blocksnumber of used blocks status

The event FreeMemory is created when the Network Component attempts to release memory.

Value in the Event Recorder shows:

  • size: size of the memory block to release in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes after the release.
  • blocks: number of allocated memory blocks after the release.
__STATIC_INLINE void EvrNetMEM_InitMemory ( uint32_t  pool_size,
uint32_t  limit0,
uint32_t  limit1 
)

Event on initialize memory management (Op)

Parameters
pool_sizesize of the memory pool
limit0usage limit 0 (limit for ethernet and BSD receive buffering)
limit1usage limit 1 (limit for TCP send buffering)

The event InitMemory is created when the Network Memory Management is initialized, that is, when the function netInitialize is executed.

Value in the Event Recorder shows:

  • pool_size: size of the memory pool in bytes.
  • limit_0: upper limit for ethernet and BSD receive buffering in bytes.
  • limit_1: upper limit for TCP send buffering in bytes.
__STATIC_INLINE void EvrNetMEM_ShrinkMemory ( uint32_t  new_size,
uint32_t  old_size 
)

Event on shrink memory block request (Op)

Parameters
new_sizenew block size
old_sizecurrent block size

The event ShrinkMemory is created when the Network Component attempts to shrink the allocated memory block. This happens when the size of the memory needed for the operation is not known at the beginning. The system assigns the maximum memory size for the required operation, and shrinks the memory when the data is created and the size is known.

Value in the Event Recorder shows:

  • new_size: new size of the memory block in bytes.
  • old_size: initial size of the memory block in bytes.
__STATIC_INLINE void EvrNetMEM_UninitMemory ( void  )

Event on de-initialize memory management (Op)

The event UninitMemory is created when the function netUninitialize is executed.