You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pavel Afremov (JIRA)" <ji...@apache.org> on 2006/10/31 16:38:16 UTC
[jira] Created: (HARMONY-2022) [DRLVM] Fix ClassLoading in
exception raised state.
[DRLVM] Fix ClassLoading in exception raised state.
---------------------------------------------------
Key: HARMONY-2022
URL: http://issues.apache.org/jira/browse/HARMONY-2022
Project: Harmony
Issue Type: Bug
Components: DRLVM
Reporter: Pavel Afremov
The following test crashes VM, if it runs with parameters -Xms16m -Xmx32m:
import java.lang.ref.*;
public class PhantomTest {
static int MAX_MEM = 0;
public static void main(String[] args) {
if(args.length>0) {
try {
MAX_MEM = Integer.parseInt(args[0]);
}
catch(NumberFormatException e) { //ignore
}
}
if(MAX_MEM <= 0) {
MAX_MEM = 100000;
}
ReferenceQueue q = new ReferenceQueue();
PhantomReference [] ref = new PhantomReference[MAX_MEM];
FinalizedObject obj = null;
for(int i= 0; i < ref.length; ++i) {
if(i > 0) ref[i - 1] = new PhantomReference(obj, q);
obj = null;
obj = new FinalizedObject(1024, i);
Reference r = null;
while( (r=q.poll())!=null) {
r.clear();
System.out.println("r = " + r);
}
}
System.out.println("TEST COMPLETED!");
}
static class FinalizedObject {
byte [] bytes;
int ind = 0;
FinalizedObject(int size, int ind) {
bytes = new byte[size];
this.ind = ind;
}
protected void finalize() {
System.out.println("Finalize: " + ind);
}
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-2022) [DRLVM] Fix ClassLoading in
exception raised state.
Posted by "Pavel Afremov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-2022?page=all ]
Pavel Afremov updated HARMONY-2022:
-----------------------------------
Attachment: Fix-ClassLoading-in-exception-raised-state.txt
Fix ClassLoading in exception raised state.
The fix consist in:
classLoadier returns NULL in exception raised state,
add missed FailedLoadingClass call ,
add OutOfMemoryError support into ReportFailedClass
add support that exception class may be not loaded
> [DRLVM] Fix ClassLoading in exception raised state.
> ---------------------------------------------------
>
> Key: HARMONY-2022
> URL: http://issues.apache.org/jira/browse/HARMONY-2022
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Pavel Afremov
> Attachments: Fix-ClassLoading-in-exception-raised-state.txt
>
>
> The following test crashes VM, if it runs with parameters -Xms16m -Xmx32m:
> import java.lang.ref.*;
> public class PhantomTest {
> static int MAX_MEM = 0;
> public static void main(String[] args) {
> if(args.length>0) {
> try {
> MAX_MEM = Integer.parseInt(args[0]);
> }
> catch(NumberFormatException e) { //ignore
> }
> }
> if(MAX_MEM <= 0) {
> MAX_MEM = 100000;
> }
> ReferenceQueue q = new ReferenceQueue();
> PhantomReference [] ref = new PhantomReference[MAX_MEM];
> FinalizedObject obj = null;
> for(int i= 0; i < ref.length; ++i) {
> if(i > 0) ref[i - 1] = new PhantomReference(obj, q);
> obj = null;
> obj = new FinalizedObject(1024, i);
> Reference r = null;
> while( (r=q.poll())!=null) {
> r.clear();
> System.out.println("r = " + r);
> }
> }
> System.out.println("TEST COMPLETED!");
> }
> static class FinalizedObject {
> byte [] bytes;
> int ind = 0;
> FinalizedObject(int size, int ind) {
> bytes = new byte[size];
> this.ind = ind;
> }
> protected void finalize() {
> System.out.println("Finalize: " + ind);
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira