I have an Arduino Uno R3 board and I compiled a test code. But now I'm trying to delete it. There are many tutorials with the same way, that is rewrite BLANK CODE. But it's not the genuine way. I want to delete all code that I manually compiled. Because the previous code will also take space in memory and after some time memory will be full. Is there anyone who has the right solution for this problem? Thanks in advance.
Every time you rewrite an Arduino, the previous code is completely wiped out (except for the bootloader, which doesn't change).
You will not fill up your arduino -- it is not like a filesystem where you are continually adding new files. Each new programming/upload overwrites all the existing code.
Uploading a blank sketch is the genuine way to "erase" an unwanted program from an arduino.