Skip to main content



      Home
Home » Archived » Memory Analyzer (MAT) » java heap size is only 20MB, but memory usage is 1.7GB
java heap size is only 20MB, but memory usage is 1.7GB [message #531935] Thu, 06 May 2010 10:37 Go to next message
Eclipse UserFriend
Hi there,

I am running a java program on Windows Vista with Java 1.6. I am using -Xmx128m. But the memory is growing to 1.7GB.

The heap dump only shows less than 20MB. So memory must be used outside java. It could be jni, but I am not aware of any.

What are other possibilities?

Any suggestions are appreciated.

Thanks,
John

Re: java heap size is only 20MB, but memory usage is 1.7GB [message #532089 is a reply to message #531935] Fri, 07 May 2010 03:18 Go to previous messageGo to next message
Eclipse UserFriend
>> What are other possibilities?
One other possibility is threads - there is some space reserved outside ot the java heap for their stacks. Just check the number of threads via jconsole or in a thread dump.

>> It could be jni, but I am not aware of any.
Even if you don't use jni on your own, jni is used in the JDK classes, for example when working with Zips, nio, ...

Just googled for leaks in zip and found this:
http://bugs.sun.com/view_bug.do?bug_id=6734186

I believe I have very little chance to hit the proper problem by just gessing like this, but you can probably find something more specific based on your appplication knowledge.

Hope this helps a bit.

Re: java heap size is only 20MB, but memory usage is 1.7GB [message #534024 is a reply to message #531935] Mon, 17 May 2010 14:12 Go to previous messageGo to next message
Eclipse UserFriend
The Java heap is only one part of the process's memory (but for most Java applications it is usually the largest part).

Native memory is also needed for the byte codes, native JVM structures, threads, DLLs, etc.

There is an excellent tool called vmmap
http://technet.microsoft.com/en-us/sysinternals/dd535533.asp x
that will show you all of the allocated memory.
Re: java heap size is only 20MB, but memory usage is 1.7GB [message #534697 is a reply to message #531935] Wed, 19 May 2010 21:27 Go to previous message
Eclipse UserFriend

Krum and Gary,

Thanks for replying to my question. Very helpful information. I will take a look and see if I can narrow the problem down.

Best,
John
Previous Topic:GC Root Unfinalized
Next Topic:Dumping Memory when VM Heap size is not at maxmemory
Goto Forum:
  


Current Time: Fri Apr 25 04:55:45 EDT 2025

Powered by FUDForum. Page generated in 0.04234 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top