From: Pablo R. M. <rod...@gm...> - 2008-07-23 20:16:47
|
Hi Mark, I am back again to tell you about a new problem I am facing using ZLive. I attempted to use ZLive intensively, running a number of threads that iterate and call the evalPred() method over approximately 500 predicates. Since each thread creates a new ZLive object, and each ZLive object consumes a considerable amount of memory, I had to run my java app with a "-Xmx500m" parameter, or someone similar, in order to give more memory to the JVM (Java Virtual Machine). Anyway, some executions finish well but others crash my JVM: java version "1.6.0_03" Java(TM) SE Runtime Environment (build 1.6.0_03-b05) Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing) I have reproduced the problem with the following program, which try to evaluate the same predicate 500 times in 12 threads: //************************************************** package pruebas; import java.io.*; import java.util.*; import net.sourceforge.czt.z.ast.Pred; import net.sourceforge.czt.animation.eval.*; import net.sourceforge.czt.typecheck.z.*; public class EvalTest{ public static void main(String[] args) { for(int i=0; i<12; i++){ (new ThreadTest(i)).start(); } } } class ThreadTest extends Thread{ private int threadNumber; private ZLive zLive = new ZLive(); public ThreadTest(int threadNumber){ this.threadNumber = threadNumber; } public void run(){ try{ TextUI textUI = new TextUI(zLive, new PrintWriter(System.out, true)); String string = "0 \\in \\dom \\{ ( 1 , \\negate 1 ) , ( 2 , \\negate 1 ) \\} \\land 1 > 0 \\land 1"; string += " \\leq \\{ ( 1 , \\negate 1 ) , ( 2 , \\negate 1 ) \\} 1 \\land"; string += "\\{ ( 1 , \\negate 1 ) , ( 2 , \\negate 1 ) \\} 0 > 10000"; Pred pred = (Pred) textUI.parseTerm(string, new PrintWriter(System.out, true)); List<? extends ErrorAnn> errors = TypeCheckUtils.typecheck(pred, zLive.getSectionManager(), false, zLive.getCurrentSection()); if(errors.size() >0) return; for(int i=0; i<500; i++){ System.out.println("Thread: " + threadNumber + " Iteración: " + i) ; zLive.evalPred(pred); } } catch(Exception e){ e.printStackTrace(); } } } //************************************************** In most executions, after printing a number of lines the JVM crashes and the error report is: # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x06302f07, pid=7736, tid=3047447440 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing) # Problematic frame: # V [libjvm.so+0x302f07] # # An error report file with more information is saved as hs_err_pid7736.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Cancelado (core dumped) I have attached hs_err_pid7736.log. I believe it could be a JVM bug. What do you think? Cheers, Pablo |