one method for preventing excessive memory accesses is to have the operating system actively manage the location of highly used memory cells using a deterministic process . fig2 and 3 illustrate the techniques of the first method . in fig2 two efram memory units 209 and 210 replace the sram units 109 and 110 shown in the conventional system of fig1 . because the efram memory units provide non - volatile memory for the system , the need for the external flash memory 111 of fig1 is eliminated . the operating system code 203 is augmented with additional embedded code forming the basis for the deterministic process . this embedded code causes separate records to be generated for each process sequence . the steps in the method are illustrated in the flow diagram of fig3 . the steps and signal paths are as follows : step 301 : the embedded code is profiled setting up event tracking for each process . step 302 : generate events data logging memory access vs . cell location within each memory block per a given time period for each process within the embedded system . step 303 : store profile of events data . this is used to identify memory blocks that have excessive access characteristics and determine the threshold update amount for each time period . step 304 : a periodic threshold check function is employed and profile information is forwarded for threshold check . step 305 : the determination in query step whether any access threshold has been met or exceeded . two outcomes are possible . outcome 1 : if the access threshold for a block has been met as indicated by the yes result then : step 306 : the target memory block for replacement has been identified . the operating system program or system software will dynamically relocate this physical block of memory and update the mmu table . the corrective action called for is : step 307 : make a copy of the memory block data to be relocated by a read of the target memory block . path 311 signifies that the read r_done is complete and sends a ready signal allowing for replacement code to be selected in block 312 . step 312 : the replacement code is selected using profile information from block 303 activating step 313 . step 313 : a write to the target memory block 306 . finally the read 307 and the write 313 have been performed . the state of the r_done signal 311 , the w_done signal 315 and the new signal 314 signify that step 308 may proceed . step 308 : reprogram mmu table is activated to update the mmu tables with the newly - assigned memory locations . outcome 2 : for each query completed in step 305 in which a no result indicates the threshold has not been met , then : path 309 activates the loop back to step 304 to perform the next periodic check of all vulnerable memory locations . similarly , upon reprogramming the memory management unit in step 308 triggered by a yes result in query step 305 , loop 310 is activated to perform the next periodic check 304 . as a result the augmented operation system code acts to replace any effected code block with the contents of a less frequently accessed code block and reprograms the physical addresses in the mmu . the once heavily - used memory locality now has contents that are not heavily accessed . the once infrequently accessed physical memory block now contains more highly accessed contents . since newly programmed mmu will now direct virtual address calls to the new physical address of the memory blocks , higher - level algorithms and code can then operate transparently without recognizing the corrective action and the relocated code would operate normally . by moving the physical location of the effected code the underlying memory cells can then be re - used by routines with less aggressive access profiles . fig4 illustrates the second embodiment of the invention , a less cumbersome method for dynamically relocating memory contents by using added program features in the memory management unit . in fig4 two efram memory units 209 and 210 replace the sram units 109 and 110 shown in the conventional system of fig1 . because the efram memory units provide non - volatile memory for the system , the need for the external flash memory 111 of fig1 is eliminated . additional logic to accumulate memory access metrics , move physical memory contents and to reprogram the virtual address table are now included in the mmu . instead of creating a memory access vs . cell location profile for an application before hand , the mmu 402 in this method contains a programmable mechanism that triggers a relocation action or event once a threshold has been met . this trigger then causes the mmu hardware to physically move the memory contents to be protected to another block of memory cells and initiates an update to the corresponding virtual address pointers . a pre - determined algorithm is used to calculate which memory block is re - allocated to the recently vacated memory block . the steps in the second method are illustrated in the flow diagram of fig5 . the steps of this method are as follows : 501 : the normal program code executed refers to unaltered system code being executed unaffected by any dynamic code relocation processes . 502 : a memory access ( read or write ) occurs on a given block of memory which is designated as block n . 503 : the mmu collects metrics information and forms or updates a table listing the number of accesses occurring at each accessed location over a prescribed period of time . after each access , this table is updated in step 503 . 504 : this query step makes the determination whether block n meets / exceeds the established threshold or not . two outcomes are possible . outcome 1 : if the query result is yes the procedure for swapping the contents of block n with the contents of block ( n + 1 ) is initiated in step 505 . 505 : the corrective action called for is : ( a ) making a copy of the memory block ( n ) data to be relocated and placing it in a temporary location ; ( b ) making a copy of memory location ( n + 1 ) and writing its contents into memory location ( n ); ( c ) writing the copy of the former content of memory location ( n ) and writing it into location ( n + 1 ). 506 : upon completing the swap of memory contents the mmu address table is updated . outcome 2 : for each query completed in step 504 , a no result activates loop 507 to proceed with program execution in step 501 . similarly , upon completing the swap of memory contents in step 506 triggered by a yes result in the query step , loop 508 is activated to proceed with normal program execution in step 501 . as a result in the second embodiment of the invention , the augmented mmu operation acts to replace any effected code block with the contents of a less frequently accessed code block and reprograms the physical addresses in the mmu table . the once heavily - used memory locality now has contents that are not heavily accessed . the once infrequently accessed physical memory block now contains more highly accessed contents . in this second method as well , higher - level algorithms and code can then operate transparently without recognizing the corrective action and the relocation of the code and can operate normally . by moving the physical location of the effected code the underlying memory cells can then be re - used by routines with less aggressive access profiles .