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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,50ad4ada98045ba X-Google-Attributes: gid103376,public From: bill@ Subject: Re: locating exceptions (Ada vs. Java) Date: 1999/03/20 Message-ID: <7d0mev$a0r@drn.newsguy.com>#1/1 X-Deja-AN: 456967294 References: <119fb4e248%hubersn@lcs.wn.bawue.de> <36efef1c.3265725@news.pacbell.net> <7cp9cp$743$1@nnrp1.dejanews.com> <36F0A77F.B0151962@rocketmail.com> <7crpn2$kt6@drn.newsguy.com> <7cvu1s$14g$2@pegasus.csx.cam.ac.uk> Organization: Newsguy News Service [http://www.newsguy.com] Newsgroups: comp.lang.ada Date: 1999-03-20T00:00:00+00:00 List-Id: In article <7cvu1s$14g$2@pegasus.csx.cam.ac.uk>, mgk25@cl.cam.ac.uk says... > >What does Java do in the case of out-of-memory exceptions in small >embedded systems (e.g., Java smartcard with 256 bytes RAM), where >there might not be space free for allocating an exception object? I am not an expert on this subject, but I understand there is a special version of the JVM run-time for embedded Java stuff? check for example http://java.sun.com/products/javacard/ selected quotes: "The Java Card specifications enable Java technology to run on smart cards and other devices with limited memory." "Java Card technology preserves many of the benefits of the Java programming language - productivity, security, robustness, tools, and portability - while enabling Java technology for use on smart cards. The Virtual Machine (VM), the language definition, and the core packages have been made more compact and succinct to bring Java technology to the resource - constrained environment of smart cards." "The Java Card Application Environment can run in devices with memory as small as 24K of ROM, 16K of EEPROM, and 512 bytes of RAM." Also check : http://java.sun.com/products/personaljava/ " technology-enabled micro web browser for consumer devices, part of its Personal Applications product suite." There seem to be all sort of Java stuff running on small devices, Java in wireless devices, etc.. So, I assume these things do work? Second, the way JVM works is that it pre-allocate memory for its heap usage at the start. so, when doing new() something, memory is always allocated from that reserved memory. the JVM does not go to the OS everytime it needs to allocate memory. (i.e. malloc(), free() works against this pre-allocated memory). So, I guess for embedded stuff, the JVM will allocate whatever memory on the board, or the device, there is or as configured and re-use only that. >Ada's exception mechanism sounds to me less comfortable, but more >foolproof here, as it does not rely on an operational heap. Well, I don't see the difference between pre-allocating some large amount of memory for use by the JVM as the heap and working within that limit throught the running of the program, and between pre-allocating some large amount of static memory. Heap and stack and static memory, are all the same thing, it is just memory ! Again, I am not an expert on this, but I just wanted to say that Java is allready being used in small devices (based on what I read, I have no personal expierence with this) , so I assume it works fine even on small devices! Bill.