The Source for Java Technology Collaboration

Home » java.net Forums » JDK » Java SE

Thread: Windows Task Manager displays faulty memory consumption?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 3 - Last Post: Oct 23, 2007 9:27 AM by: cowwoc
stylertim

Posts: 233
Windows Task Manager displays faulty memory consumption?
Posted: Oct 23, 2007 5:56 AM
 
  Click to reply to this thread Reply

Hi folks!

I'm currently developing a Java3D application involving landscape creation. This is obviously very memory consuming depending on the size of the objects used.

Still, the Windows Task Manager (WTM) seems to fail to compute the correct memory consumption. When I start my application all that is drawn are some Swing components - about 26MB of RAM is used according to WTM. After minimizing and maximizing the JFrame the consumption shrinks to 12MB which is 50% of the original value.

The same thing happens after adding the JPanel that contains the Canvas3D used to render 3D data. In my test case, involving a fractal terrain of the size 257x257 vertices represented by floating point xyz-triples, the application uses about 60MB. After the same resizing procedure the consumption shrinks to 35MB displayed in the WTM.

This behavior is given at least on XP. On Vista the consumption almost never decreases although the objects are correctly garbage collected according to my profiler, runtime heap usage and finalizers called when the relevant objects are destroyed.

I did everything to rule out me or the JVM is messing up something.

Has anyone similar experiences or some hints?

- Thomas

cowwoc

Posts: 1,055
Re: Windows Task Manager displays faulty memory consumption?
Posted: Oct 23, 2007 8:52 AM   in response to: stylertim
Correct
  Click to reply to this thread Reply

This is a known issue. I had a whole conversation about it once with someone at Sun. Turns out you can reproduce the same behavior using native applications :)

Last time I tested, Notepad uses 3MB when in the foreground and 300k when minimized. There is a rumor that Windows only cleans up the process "working set" when the GUI is minimized, for performance reasons.

As a result, Task Manager will display the maximum memory usage of your application until it is minimized. If your memory usage varies wildly (as my application's does) you will have a hard time explaining this to users. My application does image manipulation, so every once in a while memory usage will shoot up to 20MB, but when you minimize the application memory usage drops to 3MB. Try it and see :) http://www.desktopbeautifier.com/

Gili

stylertim

Posts: 233
Re: Windows Task Manager displays faulty memory consumption?
Posted: Oct 23, 2007 9:12 AM   in response to: cowwoc
 
  Click to reply to this thread Reply

Cool. At least I didn't screw up. ;)

A thing that still bothers me is why Vista does not show this behavior at all. Maybe it's edition dependant or something. Do you know where to find some additional information about this? Maybe directly from Microsoft?

Anyway, thanks for your fast reply!

- Thomas

P.S.: Neat tool. ;)

cowwoc

Posts: 1,055
Re: Windows Task Manager displays faulty memory consumption?
Posted: Oct 23, 2007 9:27 AM   in response to: stylertim
Helpful
  Click to reply to this thread Reply

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6193438 discusses this in more detail

One of the comments links to http://support.microsoft.com/default.aspx?scid=kb;en-us;293215 which confirms that this is a Microsoft issue.

Gili




 XML java.net RSS