I am working on a Windows 2003 server (64-bit) with 8 GB RAM. How can I increase the heap memory maximum? I am using the -Xmx1500m
flag to increase the heap size to 1500 Mb. Can I increase the heap memory to 75% of physical memory (6 GB Heap)?
Java – Increase heap size in Java
heap-memoryjava
Related Topic
- Java – Is Java “pass-by-reference” or “pass-by-value”
- Java – How to efficiently iterate over each entry in a Java Map
- What and where are the stack and heap
- Java – Avoiding NullPointerException in Java
- Java – How to read / convert an InputStream into a String in Java
- Java – When to use LinkedList over ArrayList in Java
- Java – How to generate random integers within a specific range in Java
- Java – How to create a memory leak in Java
Best Answer
You can increase to
2GB
on a32
bit system. If you're on a 64 bit system you can go higher. No need to worry if you've chosen incorrectly, if you ask for 5g on a 32 bit system java will complain about an invalid value and quit.As others have posted, use the cmd-line flags - e.g.
You can get a full list (or a nearly full list, anyway) by typing java -X.