Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Sometimes when I get error messages concerning freed segments, the information does not match the allocated segment before it was freed. Why?

0
Posted

Sometimes when I get error messages concerning freed segments, the information does not match the allocated segment before it was freed. Why?

0

Prior to actually freeing a memory segment, Memory Advisor uses a FIFO (first-in-first-out) queue to store information about the most recently freed segments. When the queue is full, Memory Advisor removes the first freed segment and combines it with adjoining, previously freed segments. If you access this segment after it has left the FIFO queue, it appears to Memory Advisor that you are accessing part of the previous segment, not the new segment. If the information about a freed segment is still in the queue, the error messages for these segments should be accurate. However, if the free occurred long enough ago, it may be out of the queue. Therefore, the allocation information is no longer there. If you are having this problem in your program, increase the size of the queue (using the MA_FIFO_LENGTH option), or disable the reuse of freed segments (using the MA_REUSE option).

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123