This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Unexpected OutOfMemoryError...
- From: Andrew Haley <aph at redhat dot com>
- To: gabriel dot bianco at pixeon dot com dot br
- Cc: java at gcc dot gnu dot org
- Date: Sat, 25 Nov 2006 10:12:20 +0000
- Subject: Re: Unexpected OutOfMemoryError...
- References: <1164393181.45673add1148c@www.floripa.com.br>
gabriel.bianco@pixeon.com.br writes:
>
> I have an application that is having some trouble with some allocations
> throwing
> an OutOfMemory exception when there is enough memory (or at least, it looks
> like
> there should be).
>
> I attached a test that reproduces the error.
>
> Basically, what the test demonstrates is: we attempt to make an allocation
> using
> JvNewByteArray(). It fails and throws an OutOfMemoryError exception, but there
> is in fact enough memory.
I can't reproduce this. I guess it's probably a Windows-specific thing.
The gc calls either VirtualAlloc or GlobalAlloc, depending on how it
is configured. If either of these fails, the full error information
may be retrieved by calling GetLastError.
If I were you, I'd go into os_dep.c and add a bunch of trace
information to GC_win32_get_mem to see why the gc is failing to
allocate memory.
Andrew.