Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:37 Go to next message
John Ye is currently offline John YeFriend
Messages: 20
Registered: July 2009
Junior Member
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 07:18 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
>> 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 18:12 Go to previous messageGo to next message
Gary Karasiuk is currently offline Gary KarasiukFriend
Messages: 12
Registered: July 2009
Junior Member
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] Thu, 20 May 2010 01:27 Go to previous message
John Ye is currently offline John YeFriend
Messages: 20
Registered: July 2009
Junior Member

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: Thu Mar 28 10:21:50 GMT 2024

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

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

Back to the top