<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
John R. Dennison wrote:
<pre wrap="">On Tue, May 19, 2009 at 01:45:35AM -0400, Andrew K. Bressen wrote:
<pre wrap="">Under Linux on my system, it's only (!) using 20 MB of RAM... BUT...
it is occupying 215 MB of virtual memory. I assume this is due to the
java virtual machine being a total pig; the only other java app I have
handy is a music player which takes even more memory.
That's absolutely ridiculous.
One thing to note about "Hello World!" in Java, is that it requires
*all* of the base systems to be loaded to execute. This includes the
JIT compiler, the garbage collector (which pre-allocates just in
case!), the base libraries (most of Java is *written* in Java -
*including* classes like String), and the I/O libraries. These
libraries are stored in portable format (.jar of .class files) and the
JIT compiler will compile these from portable byte code to native
instructions based on runtime profiling.<br>
Java wasn't meant to show off "Hello World." Hello World is a useless
program. It provides no value. The ability for a language to print
"Hello World" with minimal memory requirements does show off a certain
benefit, but perhaps at the expense of others. The tiniest "Hello
World" program is probably written in assembler or machine code with no
support libraries to handle scaling to support larger applications.
Some might consider writing a program such as Netrek in assembler as
ridiculous. Some might enjoy the challenge! :-)<br>
Ridiculous? It depends on the goal. :-)<br>
<pre class="moz-signature" cols="72">--
Mark Mielke <a class="moz-txt-link-rfc2396E" href="mailto:firstname.lastname@example.org"><email@example.com></a>