John R. Dennison wrote:
> On Tue, May 19, 2009 at 01:45:35AM -0400, Andrew K. Bressen wrote:
>   
>> 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.

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! :-)

Ridiculous? It depends on the goal. :-)

Cheers,
mark

-- 
Mark Mielke <mark at mielke.cc>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20090519/578ef7e1/attachment.htm