[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: SableCC hangs when 'compiling' a grammar



Hi everybody,

Thank you Mariusz and Etienne, i downloaded from the CVS the files that were
updated and i compiled them.
Indeed, the problem has not been fixed.

The behavior on my system is the same as before. It hangs, even sooner that
before (probably because the code is a little faster), with CPU usage
remaining at almost 100% and memory usage remaining at 179MByte (1MByte up
from the previous hang... ).

I just wonder how the 'scriptonite' project can compile its ECMA
grammar...... 

-- Anton

-----Original Message-----
From: Mariusz Nowostawski [mailto:mariusz@marni.otago.ac.nz]
Sent: Tuesday, May 22, 2001 18:41
To: Etienne M. Gagnon
Cc: Anton Spaans; sablecc-list
Subject: Re: SableCC hangs when 'compiling' a grammar


On Tue, 22 May 2001, Etienne M. Gagnon wrote:

> "Etienne M. Gagnon" wrote:
> > main:
> >   [1] java.util.Vector.elementAt (Vector.java:419)
> >   [2] org.sablecc.sablecc.DFA.match (DFA.java:96)
>
> There is no reason why SableCC should still be using "Vector", as it is
> "synchonized" and SableCC is not meant to be multithreaded.  I think the
> Collection API provides an ArrayList (or something similar) which
> provides the functionality of Vector, but without synchronization.
>
> I haven't fixed this because I don't have the time to do it.  If you
> want (or anybody else) to implement this modification, please free to do
> so using the current CVS snapshot.(See http://sf.net/projects/sablecc/).


Done.

I have just moved all the dependencies from synchronized Vectors to
not synchronized Lists (ArrayList). Seems to compile examples a little
faster, but I do not have any numerical statistics. Code is in CVS, I have
run tests on all the grammars we have and it works ok.


> Maybe this could get you past the VM bug (if it is really a bug related
> to locks).

I have run the "new" version of SableCC on this test grammar, and
unfortunatelly the problem is not fixed. Normally I am getting OutOfMemory
exception, and with the increased memory for Java and gc verbose I am
getting:

<AF[32]: Allocation Failure. need 96 bytes, 9299 ms since last AF>
<AF[32]: managing allocation failure, action=1 (0/234421240)
(3145728/3145728)>
<GC: Wed May 23 10:20:55 2001


and my JVM freezes in here. I am using Java(TM) 2 Runtime Environment,
Standard Edition (build 1.3.0) Classic VM (build 1.3.0, J2RE 1.3.0 IBM
build cx130-20010329 (JIT enabled: jitc))

The problematic thing is that it freezes after consuming about 400 MB of
memory (I have 512MB together RAM+swap), which means whatever it is, it is
really memory consuming thing ;o)   To make sure that something is wrong,
would be good to run it on a machine with >1GB of virtual memory ;o)

best regards
Mariusz