aspose file tools*
The moose likes Performance and the fly likes Gap between task manager to JVM memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Gap between task manager to JVM memory" Watch "Gap between task manager to JVM memory" New topic
Author

Gap between task manager to JVM memory

avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
Hey,

In task manager (virtual memeory) i see much more memory compared to the memory i see when i looking in JConsole?

Can someone explain about this gap?

Thank you
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29237
    
139

Avihai,
I would think JConsole doesn't report on the memory the JVM itself uses.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
The memory that i see in Jprofiler.

There is a gap.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3947
    
  17

What is the system you are on? Is it a 64 bit OS? Is your JRE 64 bit compatible? Is JProfiler 64 bit compatible?

With 64 bit machines you can have much more memory than 32 bit machines. Problem with this is that many applications are just 32 bit programs running in a 64 bit shell, so they can only see the 32 bit addressed memory, and they can't get to the rest that the system has available.

Just a guess though.


Steve
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

As Jeanne wrote, Task Manager (and any other operating system-based tool that reports process memory usage) reports the memory used by the java process. This includes the amount of heap allocated, the code for the JVM, the data structures used by the JVM, and so on.

Java-based tools, such as JConsole, VisualVM, and JProfiler, report on heap usage. This is always a subset of the full memory used by the java process.


JBoss In Action
avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
Sure the heap is not all the size, but in some cases the gap is too big.

look on this:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6193438

http://support.microsoft.com/default.aspx?scid=kb;en-us;293215

Do you know if there is an option to control on the java none heap size?

What will happen if the none heap size will be out of memory?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

There is no way to control the non-heap portion of the JVM memory because that is already handled automatically by the operating system as the C/C++ code that makes up the JVM allocates/deallocates structures referenced by pointers.

The bug you referenced appears to be more about perceptions that reality. Yes, doing what was suggested can effect working set memory usage, but has no bearing on commit memory (man, I hope I have these terms correct, it has been quite a while since I delved deeply into Windows memory management).

As a basic example, if the JVM asks Windows for 200MB to allocate the heap, Windows marks 200MB of memory (in this case, RAM-size + page-file-size) as reserved (committed), but physically gives the JVM only a small chunk. This small chunk is what is reported in Task Manager as used memory. Then as the JVM uses more and more of the heap, Windows gives it more and more of its allocation of the 200MB. Typically, the full 200MB is never marked as in-use because a full GC will take place well before you get there.

The suggested fix in the reported bug is, after GC, to get Windows to mark the unused heap as not in-use. But note that the memory will still be marked as reserved - that is as part of committed memory.

In Windows, when the committed memory for all process hits the maximum system memory (RAM + page file), you get an out of memory error from Windows.

As I said, it has been a while since I studied Windows memory allocation in depth, so take the above with a grain of salt, but that is what I remember.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Gap between task manager to JVM memory
 
Similar Threads
Deallocate Memory Problem
Memory Usage shown by Windows Task Manager and VM Telemetry view
Idle java application eating memory
java.exe in Task Manager
dispose(), show() methods causing memory leak