Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javaw.exe eating up my memory?

Recently, javaw.exe processes have been taking over my computer and forcing me to exit out Eclipse and other applications due to low memory errors. Note that I am not maxing out the system at all, and am I working on some basic java programs, and I have 2-3 eclipse tabs open at a time max.

I have about 40-50 of these javaw.exe processes each take up 22K-26K of RAM, which eventually eats up 70-80% of my 8GB RAM on my machine. This is extremely frustrating as I cannot do any work like this. I was wondering if anyone else has experienced this and knows how to troubleshoot this problem?

like image 790
AnchovyLegend Avatar asked Oct 08 '12 19:10

AnchovyLegend


People also ask

Is Javaw exe a virus?

javaw.exe is a legitimate file from Sun Microsystems. It is an executable file used for displaying error messages, if they occur while installing any application. It's an essential Java file and it is typically located in c:\program by default.

What is the use of Javaw exe?

Purpose. The java and javaw tools start a Java™ application by starting a Java Runtime Environment and loading a specified class. The javaw command is identical to java, except that javaw has no associated console window. Use javaw when you do not want a command prompt window to be displayed.

Is Javaw the same as Javaw exe?

Both java.exe and javaw.exe can execute java programs including jar file, the only difference is that with java.exe you have a console executed and you need to wait until your java program finishes to run any other command on the other hand in case of javaw.exe no console or window is associated with execution.

Why is java taking up so much memory?

Java is also a very high-level Object-Oriented programming language (OOP) which means that while the application code itself is much easier to maintain, the objects that are instantiated will use that much more memory.


2 Answers

You probably launch the same program again and again from eclipse, and these programs never exit. Switch to the Debug perspective, and look at the Debug view. Kill all the processes that should not run anymore.

That said, 50 * 26KB is very very far from 8GB * 80%. And I doubt any Java program can be as light as 26KB.

like image 54
JB Nizet Avatar answered Oct 19 '22 14:10

JB Nizet


It normally happens when you are doing multi threading. Make sure you stop all the threads which you have created by calling a thread.interrupt() for the the threads you have spawned before you end the application. That would remove javaw.exe from your Task Manager - Hope this will be helpful

like image 32
Anweekshiki Avatar answered Oct 19 '22 13:10

Anweekshiki