File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes Release heap memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Release heap memory" Watch "Release heap memory" New topic
Author

Release heap memory

Sidh Shah
Greenhorn

Joined: Jul 11, 2007
Posts: 5
Hello Gurus,

I have configured JamVm 1.5.3 & GNU Classpath 0.88.
Deployed web application with Jetty container, Allocated 12MB as Maximum heap size
Now, When I go through the application, JamVm heap grows, but never seen a memory goes down or releasing memory to OS as garbage collector runs
(Even garbage collection explicit execution provided on each n request from container)
Application gets out of the memory if accessing pages, As heap goes on and on ...

How to reclaim memory from Virtual machine ?

Thanks,
Siddharth Shah
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8866
    
    8

Sidh Shah wrote: but never seen a memory goes down or releasing memory to OS as garbage collector runs


I don't think the JVM ever releases memory back to the OS, and 12MB is a really small amount of memory to give to a program. The default used to be 64MB (now it is more).
If you want to monitor the internal memory state, the JDK includes JConsole, which can do that.
If you are getting an OutOfMemoryError, we have a page of helpful starting points.
Sidh Shah
Greenhorn

Joined: Jul 11, 2007
Posts: 5
Hi Joe,

Thanks for the reply.

This is for embedded environment , I can afford only 12MB of heap memory to give web application
As heap is used only for container and web application running, Few configuration data managed by application
and VM's own requirement on resources is not considered in given heap.

For JamVm, I have observed , It executes Garbage Collector when almost few KBs memory left in heap.
And parallel execution of tasks will cause out of Memory while VM try to free memory

I am not getting, if memory is not used by VM, Why it keeps, As on platform other daemons and applications are running

I think explicitly execute GC in low memory systems is not desirable , which is costly in terms on cpu and memory both ?

Does it manageable from JamVm it self ?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8866
    
    8

I don't see a lot of traffic here for JamVM. Your best bet is probably to post on their support forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Release heap memory