comp.lang.ada
 help / color / mirror / Atom feed
From: xanthian@well.com (Kent Paul Dolan)
Subject: Re: real-time Java
Date: 15 Apr 2003 18:07:20 -0700
Date: 2003-04-16T01:07:20+00:00	[thread overview]
Message-ID: <a3eaa964.0304151707.49bc24cf@posting.google.com> (raw)
In-Reply-To: 0eidnSyVZLlWzwGjXTWcpQ@gbronline.com

Wesley Groleau <wesgroleau@despammed.com> wrote (and
butchered the attributions on):

>>> (Another thing that would be nice is a JVM that is a
>>> shared library or resident in the OS or something,
>>> instead of--this is for multi-user environments, BTW--
>>> having every Java program running its own copy of the
>>> JVM.)

>> Unix and Windows will load only one copy of a binary no
>> matter if it's an executable or shared library. So there
>> is only one copy of the garbage collector code. I don't
>> see how collector data could be shared though.

> I can't speak for windows, but this is not true of
> Solaris.

Since when? Normal Unix behavior is that a virtual memory
page from a disk image of an executable is only physically
replicated if one or another of the referring routines makes
it "dirty"; otherwise, while it is being used "read-only",
all referring routines thread through a single virtual
memory copy. If it is made dirty, the reference count to the
clean copy is reduced, and the routine attempting to write
to it gets a private copy on which to scribble.

So long as the compiler and linker provide a clean division
between executing code and its mutable data, most of the
code image should be shared.

Since I used to run _many_ executables with 100 megabyte
codespace footprints in Solaris on UltraSparcs
simultaneously without running out of memory, your claim
seems suspect, but I'm not privy to Solaris internals to
refute it.

> The project I recently left had a problem reporting /
> tracking tool in Java.  Everybody used it.  That mean that
> at any given time, the physical memory and swap space had
> twenty to thirty copies of the JVM running, and each copy
> had additional memory allocated to all the same classes.

Hmm, that does raise an interesting point, though.  Even if
the JVM code space were shared, the classes are JVM _data_,
not underlying OS _code_, and so might not be sharable,
unless the clean page/dirty page rules above hold for _any_
disk page images (which might well be the case).  Even then,
there is next to no way the JIT native code could be shared,
but perhaps it is a relatively small item compared to the
classes from which it is compiled, since it is only the hot
loops of those classes.

xanthian.



  parent reply	other threads:[~2003-04-16  1:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bebbba07.0304101816.3493f42a@posting.google.com>
2003-04-11  6:10 ` real-time Java Kent Paul Dolan
2003-04-11  6:23   ` Dr. Michael Paus
2003-04-17  6:40     ` Kent Paul Dolan
2003-04-17 21:04       ` Robert A Duff
2003-04-11 11:43   ` Tum
2003-04-15  8:17   ` Darren Winsper
2003-04-15  9:23     ` Mark Thornton
2003-04-15 14:57       ` Wesley Groleau
2003-04-15 15:06         ` Mark Thornton
2003-04-15 15:50         ` Robert A Duff
2003-04-16 23:29           ` Thomas Maslen
2003-04-15 17:59         ` Wojtek Narczynski
2003-04-15 18:43           ` Wesley Groleau
2003-04-15 23:33             ` Samuel Tardieu
2003-04-16  1:07             ` Kent Paul Dolan [this message]
2003-04-15 18:47           ` Wesley Groleau
2003-04-16  5:16             ` Tor Iver Wilhelmsen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox