[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Linux and Java--a tale of two revolutions



On Wed, Dec 15, 1999 at 11:31:18PM +0530, Atul Chitnis wrote:
> Seriously - I really cannot figure out how this is supposed towork - Java
> programs are as huge as C/C++ programs, and as Arun has pointed out, they
> need tons of RAM. How are they *ever* going to build a Toaster big enough
> to put that into????

Actually, the bytecodes that make up the compiled java programs are
optimized for space rather than performance. The Java virtual machine
is a stack based machine. Operands are always on the top of the stack
and implicit. On a 64 bit machine, you have to specify memory addresses
or one of the zillion registers as a part of each instruction. In Java
bytecodes that comes for free.

But it also restricts the number of optimizations the compiler can
perform. On the other hand, the JIT compiler can perform certain
optimizations at runtime (with the knowledge that you're running on
a PIII for example), which a C compiler can't do at compile time.

This is exactly the area Mr Torvalds is working on at Transmeta.

Java is also like Emacs to some extent - it wants to startup, take 
big resources, but it wants to stay there. It is not feasible to
start a new emacs for every file that you want to edit. Similarly,
if you startup Java once and let it stay there till the machine reboots,
the resource issues aren't that bad. This is how embedded Java is 
supposed to work.

	-Arun