This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Out of memory problem


On Thu, 27 Jun 2002, Suresh Raman wrote:
> But, when I limit the maximum heap size of the program to 4MB* and run
> the same program again, I get "Warning: Out of Memory!  Returning
> NIL!" errors.   It happens nearly everytime during the 768th pass in
> the loop.  The total heap memory is almost at 4M and the free heap
> memory is at 0, when the error happens.  Given that the program does
> not use more than 2MB at any time, I expect it to run without any
> problems within 4MB.  This is unfortunately not the case.

I'm not quite sure why the explicit GC would help you, since the collector
will attempt a full collection anyway if it cannot grow the heap.

For tuning the collector I've found it helpful to build without -DSILENT,
and you might also arrange to call GC_dump() at the point of failure.
That'll help to understand what decisions the collector is making.

Also see the documentation for GC_free_space_divisor.  Increasing this can
limit heap growth to some extent.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]