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: Unexpected OutOfMemoryError...


I didn't manage to get GC_PRINT_STATS working, I have no idea why... I tried
setting the enviroment variable, defining it during compilation and also
setting the variable in the code. It just doesn't show anything :P...

The allocation seems to be failing in GC_allochblk() (allchblk.c). I attached a
log (it's messy, but it's mostly just so you can see the code path it's going
through and the failed allocation pattern).

Looking at the log, you can see that sometimes a call to GC_allochblk() will
fail, but GC_alloc_large() (malloc.c) will just call it again and it will
succeed. For whatever reason, that doesn't seem to happen sometimes (the
recalling of GC_allochblck()), and then we have an OutOfMemoryError.

I'm not sure if this helps you at all :P


Citando Andrew Haley <aph@redhat.com>:
> Ah, now, that is _very_ interesting.  The gc calls GC_oom_fn, which
> points to out_of_memory in libjava/boehm.cc:
> 
> static void * handle_out_of_memory(size_t)
> {
>   _Jv_ThrowNoMemory();
> }
> 
> Note that the size_t parameter is interesting: it tells you how big
> the failing memory request was.  It would be good to print that.  If
> you have gdb, you can put a breakpoint on handle_out_of_memory.
> 
> Also, see doc/README.environment:
> 
> GC_PRINT_STATS - Turn on as much logging as is easily feasible without
> 		 adding signifcant runtime overhead.  Doesn't work if
> 		 the collector is built with SMALL_CONFIG.  Overridden
> 		 by setting GC_quiet.  On by default if the collector
> 		 was built without -DSILENT.
> 
> Andrew.
> 


Attachment: log.txt
Description: Text document


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