You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Stepan Mishura (JIRA)" <ji...@apache.org> on 2007/10/24 14:48:50 UTC
[jira] Closed: (HARMONY-4114) [drlvm][test] Fragmentation related
tests report failure for lower heap utilization rate than RI
[ https://issues.apache.org/jira/browse/HARMONY-4114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stepan Mishura closed HARMONY-4114.
-----------------------------------
Resolution: Won't Fix
Closing as requested by Alexei Fedotov.
> [drlvm][test] Fragmentation related tests report failure for lower heap utilization rate than RI
> ------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4114
> URL: https://issues.apache.org/jira/browse/HARMONY-4114
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Environment: Windows
> Reporter: Vera Petrashkova
> Priority: Minor
> Attachments: add_remove.sh, add_remove.sh, check_source_tag.pl, check_xml_id.sh, harness_test_handler.patch, patch-for-H4114-001.patch, stress.patch, stress_1.patch, stress_1.patch, stress_1.patch, stress_1.patch
>
>
> VM intermittently throws unexpected OutOfMemoryError on the following test which defines heap fragmentation.
> This test allocates bytes arrays of different sizes.
> The arrays sizes are up to the defined MAX memory, but it is always checked that the total arrays size does not reach this MAX value.
> Some of the arrays are deleted (assigned to null) with the step which varies from 2 to 13, so, fragmentation of heap becomes high.
> Test fails on DRLVM with -Xmx64M and sometimes VM crashes on this test without of throwing OutOfMemoryError.
> On RI this test always passes with -Xmx64Mю
> -------------fragTest.java------------
> public class fragTest {
> public final static int NUM_IT = 1000000;
> public final static int MAX_MEM = 44000000;
> public final static int BSIZE = 65536;
> public final static int MIN_BSIZE = 1;
> public final static int PERIOD = 25000;
> static int count=0;
> static int totalSize = 0;
> public static byte [][] ref = new byte [NUM_IT][];
> public static void main(String[] args) {
> int i = 0;
> try {
> for (; i < NUM_IT; ++i) {
> // size varies from MIN_BSIZE to (BSIZE + MIN_BSIZE)
> int size = ((i + BSIZE) % BSIZE) + MIN_BSIZE;
> while (totalSize + size > MAX_MEM) {
> size = size / 2;
> if (size < MIN_BSIZE)
> break;
> }
> if (size >= MIN_BSIZE) {
> ref[i] = new byte[size];
> totalSize += size;
> }
> count++;
> // clearing of arrays on PERIOD step
> if (count > PERIOD) {
> // clearing of arrays is perfromed with the step,
> // which varies from 2 to 13, so, the heap becomes
> // fragmented
> int step = (i % 13) + 2;
> for(int j = 0; j<i; j+=step) {
> if ( ref[j]!= null) {
> totalSize-=ref[j].length; //recalculate total size
> ref[j]= null;//clear array
> }
> }
> count = 0;
> // System.err.println("Total size = " + totalSize);
> }
> }
> System.err.println("Test passed, Total size = " + totalSize);
> } catch (OutOfMemoryError e) {
> System.err.println("OutOfMemoryError is thrown. Total size = "
> + totalSize + " i = " + i);
> System.err.println("Test failed");
> }
> }
> }
> -----------------
> Run this test several times.
> java -Xmx64M fragTest
> On RI output always is the following:
> ===============
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> Test passed, Total size = 44000000
> DRLVM output:
> =============
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r545076, (Jun 7 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> The GC did not provide gc_add_weak_root_set_entry()
> OutOfMemoryError is thrown. Total size = 39269205 i = 50083
> Test failed
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r545076, (Jun 7 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> The GC did not provide gc_add_weak_root_set_entry()
> Out of Memory!
> This bug causes the itermittent failures of gc.frag tests from stress test suite (http://issues.apache.org/jira/browse/HARMONY-3536)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.