This won't solve the problem. On page refresh, the memory is renewed anyway. The problem is that if you don't clean the memory from loaded objects, listeners, observers... your app will get slower the longer you use it. It is best practice to clean up resources as soon as you don't need them anymore. In the preview upload scenario, this would be, for example, when you change the input, when you actually upload, or when the current component is unloaded.