Frage

JDK on Windows takes max around 2 GB RAM. Even if we allocate more RAM to our JDK; it doesnt take it. If I need to run a process which need 8 GB RAM on Windows; how can I achieve it ?

Do we have any JDK provided by any other provider which could support it ? Memcached provides us additional cache which can be used... but that is not I am looking for. Suppose I need to run my jMeter with 8 GB RAM on my windows box; Memcached wont help for sure.. Is there any provider which provides me with this ? Previosly I thought Terracotta does that; but looks like that also is like Memcached.

I am using Windows 7. If needed I can use Windows Server also.. I just need to get it running.

War es hilfreich?

Lösung

As far as I know there is a 2GB memory limit per 32 bit process on Windows. However this page seems to indicate there are register settings to expand that to 3GB. Specifically IMAGE_FILE_LARGE_ADDRESS_AWARE

http://msdn.microsoft.com/en-gb/library/windows/desktop/aa366778(v=vs.85).aspx

So if you are using a 32bit JDK and stuck with it, that is is your best bet, however if you can upgrade to a 64 bit JDK do so, as if you use a 64 bit JDK on the a 64 bit version of windows this limit becomes 8TB

Andere Tipps

using 64bit JDK on 64bit OS fixes it

If you use -ms8g -mx8g and it starts correctly then it has a "minimum" heap size of 8 GB. However, If your program doesn't use 8 GB it still might be only 2 GB or less. i.e. A hello World program will not use 8 GB no matter what settings you give it. (Except an obscure one I don't think any uses ;)

What makes a 32-bit application, 32-bit is the limited address space it has. It can still use 64-bit or even 128-bit data. It is the limited amount of memory it can address which distinguishes it. Windows uses allot of the address space for it's own purposes which means your real limit is about 1.2-1.5 GB for the heap (not 2^32 which is 4 GB)

It is worth noting that a 64-bit JVM still uses 32-bit references up to a heap size of about 30 GB. i.e. the references are not plain memory addresses as they are for a 32-bit program.

I have sucessfully used 12G (-Xmx12G) on my 64 bit windows machine, and the (64 bit) JVM used every byte of it.

The only problem I stumbled upon was that sometimes it was needed to explicitely provide -d64 on the command line, event if it's a 64 bit JDK/JRE.

If you have huge amount of cached data, they better reside out of java heap. Otherwise, GC will spend lots of time traversing it, repeatedly and fruitlessly.

Terracotta's BigMemory does that by putting data in direct ByteBuffer, which is outside Java heap. Maybe there are free/open ones too.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top