3

I am running this version of Java:

java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

I am running this on a Windows 2008 R2 64-bit server on Amazon EC2, in an m1.large instance that has 7.5GB of memory.

When I start my Java app, I am using this command line:

java -Xms6G -Xmx6G -server -jar start.jar

My intent is to have Java reserve 6GB for it's heap, so that when my application runs, it will be able to load its entire dataset into memory.

However, when I start the app, I only see 1.3GB of memory used in Task Manager?

2
  • if you see 1.3GB is being used, then what is wrong? If you get Heap size exception with 1.3GBusage, then for me the question makes sense Commented Oct 2, 2012 at 1:07
  • @elbek I requested 6G, so to see only 1.3G reserved is a problem... Commented Oct 2, 2012 at 4:22

1 Answer 1

7

The issue is you're looking at the default memory column shown in Task Manager, which is "Memory - Private Working Set." This doesn't reflect what is actually reserved for use.

In Task Manager, go to the View menu and choose Select Columns. Add the "Memory - Commit Size" column. You should see this column reflects the reserved heap size from Java. In my tests, it shows around 6.6GB committed for a commandline of -Xms6G.

Here is Microsoft's page that explains what each column means.

"Memory - Private Working Set: Subset of working set that specifically describes the amount of memory a process is using that cannot be shared by other processes."

"Memory - Commit Size: Amount of virtual memory that is reserved for use by a process."

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.