Why Memory Shown in java process manager in TDV is different than the memory shown on windows Task manager?

Why Memory Shown in java process manager in TDV is different than the memory shown on windows Task manager?

book

Article ID: KB0082180

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization 7.0.6, all versions,

Description

Why Memory Shown in java process manager  in TDV is different than the memory shown on windows Task manager?

Issue/Introduction

Why Memory Shown in java process manager in TDV is different than the memory shown on windows Task manager?

Resolution

The memory shown as being used by TDV in Windows Task Manager is expected and does not indicate a memory problem or leak.

When a Java process is started up, the JVM will request the amount of memory specified in the -Xmx option in the VM args supplied to the Java process. In TDV, you generally set this parameter in Studio > Administration > Configuration > Server > Memory > Java Heap > Total Available Memory. However, if you are using the script_env.bat in <installation_dir>/conf, it will override this setting and use the -Xmx option set in the CIS_SERVER_VM_ARGS string.

This total memory is “reserved” for the JVM by the OS, but until it is used, it will not be allocated. As soon as it is used and allocated, it doesn’t become unallocated until the JVM is shut down. This is the “Memory (Private Working Set)” usage you are seeing in the Task Manager (Details). This value will increase, but will not decrease until the Java process is ended. It is reserved for the Java process, and no other process running on the server can access it.

A more accurate depiction of the actual memory that is currently being used by the JVM is in the Studio > Manager > Memory panel. It shows a graph of the heap (used for disposable Java objects), and a graph of the memory CIS “manages”. Managed memory is used to spill large volumes of data to disk if there is too much to retain in memory. Even this graph can be deceiving, because it can hold objects that have been freed and are available for garbage collection but haven’t been collected yet.

There are a lot of resources on the web that explain Windows and Java memory management, but this post may interest you:

http://stackoverflow.com/questions/12017437/jvm-memory-why-memory-on-task-manager-difference-with-jprobe-or-jconsole-tool

“Also note that usually processes that request more memory from OS, this memory is kept by them even when the actual application "frees" memory. These memory pages have been mapped as part of the process’s address space. So in your Task Manager you would not see a pattern of decreasing memory, but that would not indicate some memory leak from your application.”