This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: Allocate memory
- From: "Boehm, Hans" <hans dot boehm at hp dot com>
- To: Dimiter Stamenov <pamir at abv dot bg>, "java at gcc dot gnu dot org" <java at gcc dot gnu dot org>
- Date: Tue, 12 Feb 2008 19:57:46 +0000
- Subject: RE: Allocate memory
- Accept-language: en-US
- Acceptlanguage: en-US
- References: <1465603931.121123.1202842659446.JavaMail.nobody@mail53.abv.bg>
This is a reasonably new version of gcj? On a 32-bit platform? LinkedList or ArrayList? Windows? Linux?
Certainly allocating 128 MB should not be an issue. Allocating a single 128MB contiguous object might be an issue, at least if you do it repeatedly on a 32-bit platform.
You can often get some idea what's going on by defining the GC_PRINT_STATS environment variable, and looking at the resulting GC log.
Hans
> -----Original Message-----
> From: java-owner@gcc.gnu.org [mailto:java-owner@gcc.gnu.org]
> On Behalf Of Dimiter Stamenov
> Sent: Tuesday, February 12, 2008 10:58 AM
> To: java@gcc.gnu.org
> Subject: Re: Allocate memory
>
> In fact I know very well why it's running out of memory - I
> must fill a large List which consumes the memory.
>
> When I use standard JRE I am starting application with
> -Xmx128M argument and it is OK, but with gcj I don't know
> what to do...
>
> May be in this case I can not use gcj at all, what do you think?
>
>
> >-------- Оригинално писмо --------
> >От: Andrew Haley <aph@redhat.com>
> >Относно: Re: Allocate memory
> >До: Dimiter Stamenov <pamir@abv.bg>
> >Изпратено на: Вторник, 2008, Февруари 12 19:52:33 EET
> >----------------------------------
> >
> >Dimiter Stamenov wrote:
> >> OK, but I am getting OutOfMemoryException - so what could be done?
> >
> >Well, it's either really running out of memory or you've hit a bug.
> >
> >> Do you mean that I have to rewrite that part of the code in C++?
> >
> >I wouldn't have thought so. The stack trace should give
> you an idea why it's >running out of memory.
> >
> >Andrew.
> >
> >
> >> >Dimiter Stamenov wrote:
> >> >> Hi,
> >> >>
> >> >> Is there any way in gcj compilation to tell the
> compiled executable to allocate more memory?
> >> >
> >> >> I mean something like -Xmx JVM argument when running
> a pure Java application.
> >> >
> >> >Not that I know of. It's not something you'd need, anyway:
> >> >our gc doesn't allocate memory in a single block as
> Sun's JVM >> >does.
> >
>