Tuesday, May 3, 2011

Mark phase misdetection on garbage collection for C

Hello, I've looked at Conservative GC Algorithmic Overview

Can a misdetection happen in the 'marking' part? If some data is stored and by coincidence happen to be the same as an address of an allocated memory, will the collector keep the memory ?

From stackoverflow
  • Yes, that's why it is called conservative. Every integer that looks like it points inside the heap will make the region non-garbage. And as a result, a memory leak may occur.

  • Yes.

    That's why it's called "conservative", I think.

    akappa : Amazing, my answer is almost identical to that of Unknown :D

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.