Many of you might have faced this issue when ejecting pendrive or USB harddrive from the computer. This issue comes when the content of the pendrive pf the external drive being used by the system. For example, consider a word document from a pendrive is opened. Now you will not be able to safely remove the pendrive without closing the word document. Some applications(in the background) will be using the content of the pendrive even after closing the application. In this we do not know which application is using which content of the pendrive. To solve this issue there is an application called Unlocker which can be used to kill the processes that are using the content of the pendrive.
The size of the application is less than 1MB. To safely remove the pendrive, just rigth click on the drive and click Unlocker which displays the list of files which are being accessed by the processes in the system. Hit Unlock. The problem is solved.