A system for selective self-healing of memory errors comprises a processor
coupled to a memory, where the memory stores instructions executable by
the processor to store an error record for each memory management error
detected during an execution of the application. The error record
identifies an allocation location (e.g., a portion of a stack trace
corresponding to the invocation of a memory allocation function such as
malloc( )) of an object associated with the memory management error. The
instructions are executable to use the error record to identify, during
subsequent execution, memory operations performed on objects allocated
from the allocation location, and to perform corresponding memory
protection operations (e.g., operations to prevent re-occurrences of the
memory errors) for the memory operations identified using the error
record.