Eclipse.exe and windows processes
One of our clients mentioned that his users sometimes wish to kill the process associated with its Scout client application in the Windows Task Manager. Scout applications use the Eclipse Launcher exe like any Eclipse RCP application or the Eclipse IDE itself. I will use "eclipse.exe" as application name in this blog post.
The problem was that in order to completely terminate the client application, they need to be aware of the fact that their application was actually running in two processes, the eclipse.exe and the javaw.exe process. By just using “End Process” (button or context menu) on the eclipse.exeprocess in the Task Manager, only the smaller process is killed and the much larger javaw.exe process continues to run. Only by selecting “End Process Tree” in the task manager the complete application is terminated. Only few users were aware of this setup that is not really user-friendly.
After some investigation we could propose a solution to address the client’s issue. The Scout client application now appears as a single process in the Task Manager and it no longer matters if users click on context menu “End Process” or “End Process Tree”.
In the reminder of this article we summarize our findings that should directly apply to any Eclipse RCP application or the Eclipse IDE itself.
To visualize the dependencies between the individual Windows process the Windows Process Explorer Tool can be used.
Using this tool we can now see how javaw.exe is a sub process of eclipse.exe:
In this case eclipse.exe is quite an empty process and killing it without killing the process tree does not free the memory allocated to the javaw.exe process.
In the past, we have noticed that eclipse applications containing a JRE subfolder (“Bundle JRE for this Environment with the product” in the product editor) were represented by a single process in the Task Manager. It also works if instead of a JRE subfolder, a shortcut pointing to the real JRE folder is used.
It is possible to create the same behavior by letting the -vm parameter point to the jvm.dll instead of the in the javaw.exe in the eclipse.ini file (see also the list of runtime options for the eclipse.ini file)
With the following setting in the eclipse.ini file the client has a single process that represents the Scout RCP client.
Using the Windows Process Explorer we can now verify, that the eclipse.exe process does no longer start any sub-process.