• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

does gc return memory to operation system?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm novice, if my question is too simple or strange to answer, forgive me.

I engaged a project developed by swing, and configure -Xms32m and -Xmx64m as project maximum memeory for jvm. when i open some frames contains
some Jpanel contiunally, the window's taskmanager show memory occupied by javaw rise again and again.
my question is: since jvm start with -Xms32m, it should have has enough memory for some frames, why malloc from operation system?
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, if you are using Windows Task Manager to look at memory usage, be sure to use the "VM Size" column. The "Mem Usage" column can be confusing, as it relates to physical memory.

Second, even when looking at VM Size column, this is telling you about all memory used by the JVM. The Java heap is only one part of that memory. There is additional memory for the JVM's implementation code, loaded Java classes and a variety of other non-heap resources.

In your particular application, I would be surprised if Java was actually increasing the heap size from the initial 32 Mbytes. If it is, then I suspect that either your application is more complicated than you suggest or you have a leak.

To find out whether your application really is increasing the heap size, try setting the maximum heap to 32 Mbytes as well. If the application runs OK and the VM Size is similar to before, then any observed memory consumption increase is due to things other than Java heap.
 
w jc
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,Peter Chase
thanks for your reply.

the phenomenon i talked last article is based on IBM JDK1.3, then i
replace it with SUN JDK 1.4, the strange phenomenon disappeared.

Suppose IBM modified System.gc()? any way to solve this question which
my project must run with IBM JDK1.3?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
System.gc() isn't guaranteed to do anything, so it might well be that the IBM implementation differs significantly from Sun's.
 
This is my favorite show. And this is my favorite tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic