1. A method in a data processing system for executing instructions, the method comprising: executing instructions in a processor in the data processing system; detecting indicators during execution of the instructions, wherein the indicators are data values in memory that specify counting of events that are associated with execution of the instructions or are data values in memory that specify counting of events that are associated with accesses to memory locations; counting events that occur within the data processing system as specified by the indicators; retrieving a count value that represents counted events; and relocating one or more memory blocks that include the instructions or that include the memory locations based on the count value.