Link to home
Start Free TrialLog in
Avatar of AntiBit
AntiBit

asked on

Weird Problem: Difference between javaw.exe and java.exe (?)

Hi!
I hav programmed a little app and noticed a very weird memory-poblem:

When I create an executable-jar File of my compiled source and run the App,
the task-manager tells me that this process ("javaw.exe") needs ~20 MB of Memory.
That's way too much, it is no big application... And it doesn't get less, indeed it
does increase the amount of needed RAM a little bit.

BUT...
When I directly open a DOS-Propt and start my App. by typing "java ProgramName", then
the TaskManager tells me that this process ("java.exe") needs ~20 MB of memory, too.
But after a few minutes the amount of needed RAM decreased to about 240 KBytes! Like
it should be...

So what is the difference between javaw.exe and java.exe?? Why does running the JAR need permanently
that much memory (20 MB), while normal executing behaves as it should normally behave (pending memory-use
between 200KB and 8 MB). How can I change that?

Thank you for your answers!
AntiBit
Avatar of Zeroshade
Zeroshade

From what i understand javaw.exe is used for gui based applications where as java.exe isn't. My guess would be JVM is requiring that much memory to handle the gui actions?
Avatar of Mick Barry
> RAM decreased to about 240 KBytes

Thats seems really low.

The amount of heap allocated to the JVM can be controlled by the command line options -Xms -Mmx. Have a look at "java -X" for more details.

AFAIK, the only difference between java and javaw is that java interacts with the console, and javaw runs without a console (stdin, stdout, and stderr won't work), and without a window for that matter.

brian
Avatar of AntiBit

ASKER

Thanx for your comments!
Ok, now I know the difference between java and javaw, but that doesn't explain why the javaw.exe memory increases and increases and doesn't seem to do any garbage-collecting.

But java.exe does...
Why? What can I do to change this?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
AntiBit:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept objects' comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer