Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does javaw.exe process in windows 64 consuming more memory?

I switched from Windows 7 (32 bit) to Windows 7 (64 bit) because i added 4 Gb RAM to my 2 GB. And now when I'm running Eclipse Juno EE. In Windows Task Manager I see that process javaw.exe is eating ~380 Mb RAM, I didn't saw this before, when I was using 32-bit OS. I didn't even try to lunch any projects. I wrote this code:

public static void main(String[] args) {
    Runtime runtime = Runtime.getRuntime(); 
    System.out.println(runtime.maxMemory());
}

It shows that for my JVM is allocated 1 338 507 264 bytes.

It means that when I will run projects, this process may consume up to 1.3 Gb Ram ?!

Will I have any problems with this in future ?

like image 315
Danylo Volokh Avatar asked Dec 17 '12 10:12

Danylo Volokh


1 Answers

The 64-bit version will use the -server JVM and it has a higher default maximum heap size. The Windows 32-bit version uses the -client JVM by default and it uses less resources by default as it designed to run on smaller machines, it tends to be slower for long running programs as a result (the client JVM has faster loads for short running programs like applets)

If you set the maximum heap size, they should use about the same amount of memory if you have a recent version of Java 6, or Java 7.

like image 82
Peter Lawrey Avatar answered Oct 19 '22 02:10

Peter Lawrey