A computer-implemented method for determining whether to apply one or more mitigation actions when executing a memory operation for a calling software module, the method comprising: executing (312, 314) at least one first memory operation for the calling software module, the executing comprising applying the one or more mitigation actions, wherein the one or more mitigation actions comprise, for an allocation operation, allocating more extra memory than requested in the allocation operation and writing a marker value to the extra memory; evaluating (708, 730) whether the one or more mitigation actions successfully prevented a memory error from impacting the calling software module, wherein evaluating whether the one or more mitigation actions successfully prevented a memory error from impacting the calling software module comprises reviewing the extra memory to determine whether the extra memory holds the marker value; determining the likelihood that the one or more mitigation actions reduces memory errors affecting the calling software module, wherein determining the likelihood comprises updating, based on the act of evaluating, a statistic for the calling software module indicating a success of the one or more mitigation actions over a plurality of instances of the calling software module, and wherein the act of subsequently executing is performed in accordance with the statistic, in particular wherein the statistic is a mitigation ticket value, and wherein updating the statistic comprises incrementing the mitigation ticket value if the one or more mitigation actions are successful and decrementing the mitigation ticket value if the one or more mitigation actions are not successful; and subsequently executing (312, 314, 316) at least one second memory operation for the calling software module in conjunction with which the one or more mitigation actions is selectively applied based on the likelihood, the executing comprising: executing (312, 314) the at least one second memory operation for the calling software module in accordance with the one or more mitigation actions if the determined likelihood is above a threshold, and executing the at least one second memory operation for the calling software module without the one or more mitigation actions if the determined likelihood is below a threshold. executing (312, 314) at least one first memory operation for the calling software module, the executing comprising applying the one or more mitigation actions, wherein the one or more mitigation actions comprise, for an allocation operation, allocating more extra memory than requested in the allocation operation and writing a marker value to the extra memory; evaluating (708, 730) whether the one or more mitigation actions successfully prevented a memory error from impacting the calling software module, wherein evaluating whether the one or more mitigation actions successfully prevented a memory error from impacting the calling software module comprises reviewing the extra memory to determine whether the extra memory holds the marker value; determining the likelihood that the one or more mitigation actions reduces memory errors affecting the calling software module, wherein determining the likelihood comprises updating, based on the act of evaluating, a statistic for the calling software module indicating a success of the one or more mitigation actions over a plurality of instances of the calling software module, and wherein the act of subsequently executing is performed in accordance with the statistic, in particular wherein the statistic is a mitigation ticket value, and wherein updating the statistic comprises incrementing the mitigation ticket value if the one or more mitigation actions are successful and decrementing the mitigation ticket value if the one or more mitigation actions are not successful; and subsequently executing (312, 314, 316) at least one second memory operation for the calling software module in conjunction with which the one or more mitigation actions is selectively applied based on the likelihood, the executing comprising: executing (312, 314) the at least one second memory operation for the calling software module in accordance with the one or more mitigation actions if the determined likelihood is above a threshold, and executing the at least one second memory operation for the calling software module without the one or more mitigation actions if the determined likelihood is below a threshold.