You do not need to clear the memory or anything else on Linux after an application terminates - I suspect it's the same on Windows but I wouldn't really know.
Since you do not provide any useful information in your question, such as the amount of physical memory on your system or how you came up with the idea that the memory needs to be "cleaned", I can only take a few of shots in the dark:
When a WINE application terminates you may occasionally have a remaining wineserver
process which can consume both CPU and memory resources, thus slowing down any other application. That process handles, among other things, cross-application shared resources in the WINE environment.
If you want to completely terminate the WINE session, you can try terminating the wineserver
process manually. Keep in mind that you may lose the contents of the WINE clipboard if you do that.
If you use an application - any application, not just under WINE - with significant memory requirements (Photoshop comes to mind) for medium to long amounts of time, the Linux kernel will slowly swap out to the disk the memory pages used by the other applications to free more RAM for the current application.
Once you start using those applications again, the memory pages that were swapped out will need to be retrieved from the disk, which will slow them down for some time.
This kind of slow down will recede after while, as more and more memory pages are placed back into the main memory.
It is possible for a stalled wine
process to remain, despite the application being terminated. You should check the running processes for any remnants.
In any case you should monitor your system with a CPU and memory usage monitor before coming up with any conclusion regarding the cause of a slow down - htop
is a quite useful tool for this. Look for processes that use too much CPU time or too much memory. Using an I/O monitor or watching the disk LED for activity may also provide useful hints.
EDIT:
I just saw your comments - 2GB of RAM is on the low end these days, both for image processing and for an IDE such as NetBeans. You are bound to experience extensive memory swapping which will slow down things noticeably, especially when you switch from one application to another.