[clug] Why isn't Java popular on the Linux Desktop? [SEC=PERSONAL]

Sam Couter sam at couter.id.au
Mon Jul 13 15:10:51 MDT 2009


Martijn van Oosterhout <kleptog at svana.org> wrote:
> But it makes it useless for interactive programs, since you have to
> determine at startup how much memory you think you'll need during the
> entire duration of the program. I understand the pressure argument, but
> surely if the GC sees that 90% of allocated memory is really in use, it
> could think to just allocate more from the OS...

Yes, it's a pain. But how is the VM supposed to know what memory is
really in use unless it runs the GC? You've just designed a VM that will
use *all* your available memory before getting aggressive with the GC.
Aggressive GC is costly and there's no way to know ahead of time if it
will pay off, so it's only done when necessary, ie, when memory is
scarce.

The limits on memory usage keep Java applications from getting out of
control.

> Put it another way: I can't think of another programming language that
> requires you to specify at program startup how much memory you want to
> use.

Nitpick: It's the VM implementation, not the language.

I can't think of another VM that does lazy GC like Java does. Languages
like Perl and Python do their collection when objects become
unreferenced. Java does it later and gains huge performance benefits for
it.
-- 
Sam Couter         |  mailto:sam at couter.id.au
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20090714/1d1747f2/attachment.bin


More information about the linux mailing list