Article View: comp.lang.java.programmer
Article #412Re: OutOfMemoryException when memory is available
From: Artur Biesiadowski
Date: Fri, 08 Oct 1999 00:00
Date: Fri, 08 Oct 1999 00:00
53 lines
2738 bytes
2738 bytes
Mike Manning wrote:
>
> While researching an OutOfMemoryException, when all appearances are that
> there is memory available, I discovered that several others have had
> this problem.
[...]
I've changed test a bit to print only once per 100 entries to make it
run faster.
[...]
DATA: 0% free total = 4128768 free = 7840 count = 110000
DATA: 0% free total = 4128768 free = 5320 count = 110100
DATA: 0% free total = 4128768 free = 2800 count = 110200
Caught java.lang.OutOfMemoryError
null
java.lang.OutOfMemoryError
<<no stack trace available>>
FAILED: 0% free total = 4128768 free = 280 count = 110300
This is under JDK1.3
Under JDK1.2 + hotspot program tries to gc desperately, almost stopping
program at
DATA: 3% free total = 4063232 free = 131552 count = 113300
DATA: 3% free total = 4063232 free = 131200 count = 113400
DATA: 3% free total = 4063232 free = 130192 count = 113500
DATA: 3% free total = 4063232 free = 128592 count = 113600
which is bad, but distant from 37% you were talking about.
Under JDK1.2 classic
DATA: 8% free total = 4194296 free = 344016 count = 101600
DATA: 8% free total = 4194296 free = 341968 count = 101700
DATA: 8% free total = 4194296 free = 345424 count = 101800
Caught java.lang.OutOfMemoryError
null
java.lang.OutOfMemoryError
FAILED: 8% free total = 4194296 free = 343848 count = 101900
Worst of all, still 8% is more acceptable than 37%. I've run all
programs for 500000 iterations, I'm not sure if it makes a difference.
Note that this program is quite syntetic - in classic vm a lot of memory
will be used in handles, not object data. Maybe they have some problems
with such number of handles. Anyway, under both hotspots, outcome is
quite good I think.
Artur
Technical Details
Message-ID:
<37FDADF3.F474066E@pg.gda.pl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37FCC92D.F923AB42@peakss.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bb9b,aa2b9e2404c5bed9 X-Google-Attributes: gid10bb9b,public X-Google-Thread: 10a146,aa2b9e2404c5bed9 X-Google-Attributes: gid10a146,public X-Google-Thread: f74b3,aa2b9e2404c5bed9 X-Google-Attributes: gidf74b3,public From: Artur Biesiadowski <abies@pg.gda.pl> Subject: Re: OutOfMemoryException when memory is available Date: 1999/10/08 Message-ID: <37FDADF3.F474066E@pg.gda.pl> X-Deja-AN: 534244455 Content-Transfer-Encoding: 7bit References: <37FCC92D.F923AB42@peakss.com> X-Accept-Language: pl,en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@task.gda.pl X-Trace: korweta.task.gda.pl 939372214 22483 153.19.40.60 (8 Oct 1999 08:43:34 GMT) Organization: CI TASK http://news.task.gda.pl/ Mime-Version: 1.0 NNTP-Posting-Date: 8 Oct 1999 08:43:34 GMT Newsgroups: comp.lang.java.programmer,comp.lang.java.machine,borland.public.jbuilder.java.language