From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d59853e2dd116420 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-02 12:10:53 PST Message-ID: <3D4AD595.A224558C@sympatico.ca> From: David Marceau X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.17-10mdksmp i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Help: Problem with JGnat References: <3d49f31b@oit.umass.edu> <3D4A3D23.6090905@ib-paus.com> <3D4A7C39.2AF0BA8@earthlink.net> <3d4aae3a$1_1@rcfnews.cs.umass.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 02 Aug 2002 14:55:17 -0400 NNTP-Posting-Host: 65.92.163.16 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1028315004 65.92.163.16 (Fri, 02 Aug 2002 15:03:24 EDT) NNTP-Posting-Date: Fri, 02 Aug 2002 15:03:24 EDT Organization: Bell Sympatico Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:27624 Date: 2002-08-02T14:55:17-04:00 List-Id: What about trying to turn the JIT compiler off? There's a switch/environment variable for this in the jdk docs. That's how it could work with jdk 1.3. You have to turn the jit compiler off. In this mode it's as if it was running the jdk 1.2.2 compiler :) It's also good to do this when debugging just java IMHO. Bin Chen wrote: > > Thank you very much. > > Bin > > "Marc A. Criley" wrote in message > news:3D4A7C39.2AF0BA8@earthlink.net... > > "Dr. Michael Paus" wrote: > > > > > > Bin Chen wrote: > > > > Hi, > > > > > > > > I used jgnat compile the following Ada program to Java bytecode, it > was OK, > > > > but when I ran the .class file, it always threw the following > exception. > > > > Could you give me any feedback? > > > > > > Which version of Java are you using? JGNAT does not work on recent Java > > > distributions anymore unless there is a newer version than the one I > have. > > > (1.1p). See also the comment on http://www.gnuada.org/rpms313p.html > about > > > JGNAT. > > > > Yep, JGNAT 1.1p works (mostly) fine with with JDK 1.2.2, but tasking is > > broken when used with JDK 1.3. And I've not tried it with JDK 1.4, but Hmmm. I remember looking at the jgnat sources and IMHO ACT mapped every ada task to a java Thread class and not the Runnable Class. In the HPCJ(High Performance Computing with Java) book, the author mentioned a flaw with Thread class. The Thread once started and then after finishing the contents of the run() would pretend to be garbage collected but it's not. Which means if you run 300000 Thread.run()'s you're bound to have a memory/resource leak issue since the Thread objects are really only garbage collected when the entire main() process is exited. This HPCJ book suggests using a Thread pool which are expected to exist throughout the process lifetime. As soon as one Thread is terminated, you may assign another Runnable to it hence saving resources.i.e Thread pool of say 10000 Threads. Instantiate and Thread.setTaskRunnable(new adaRunnable(XXX)); and then thisthread.start(); In this manner, it could be a bit more resilient to memory/resource issues :) Runnable objects are garbage collected as expected. Thread objects are not. I wonder if this has something to do with the jgnat Tasking being broken? Cheers, David Marceau