Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

how to share data/memory between mutiple JVMs ?

Thread view: 
Jeff.C - 25 Jul 2006 08:46 GMT
Since JVM is a process of OS, is there any approach to share
data/memory between JVMs ?
Ingo R. Homann - 25 Jul 2006 11:12 GMT
Hi,

> Since JVM is a process of OS, is there any approach to share
> data/memory between JVMs ?

With standard-java there is AFAIK no possibility to share memory (on a
low level). But of course you can use Sockets, RMI, CORBA, a WebService,
or ... to let two applications "communicate" (exchange data) with each
other.

Hth,
Ingo
Jeff.C - 25 Jul 2006 16:35 GMT
I see your points.
I just wanna optimize a legacy muti-jvm ( muti-processes) system, in
which a lots of static data are stored in each process. and it will
consume lots of memory.
So RMI, Socket, ... is not suitable for access such lots of static
data.
If the jvm has a extension to create/access share memory, I believe it
will be a great feature.

Ingo R. Homann 寫道:

> Hi,
>
[quoted text clipped - 8 lines]
> Hth,
> Ingo
Jeff.C - 25 Jul 2006 16:44 GMT
Just an update,
As a new feature, JDK 1.5 can share read-only data between JVMs.  :-)

Jeff.C 寫道:

> I see your points.
> I just wanna optimize a legacy muti-jvm ( muti-processes) system, in
[quoted text clipped - 19 lines]
> > Hth,
> > Ingo
Gordon Beaton - 25 Jul 2006 16:50 GMT
> If the jvm has a extension to create/access share memory, I believe
> it will be a great feature.

You won't find support for this in Java, but it's possible using
native code. Many years ago I implemented a Map that used SysV shared
memory as backing store, allowing multiple JVMs to share its contents.

/gordon

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

Thomas Hawtin - 25 Jul 2006 17:30 GMT
>> If the jvm has a extension to create/access share memory, I believe
>> it will be a great feature.
>
> You won't find support for this in Java, but it's possible using
> native code. Many years ago I implemented a Map that used SysV shared
> memory as backing store, allowing multiple JVMs to share its contents.

You've been able to do this in Java for a number of years now...

http://download.java.net/jdk6/docs/api/java/nio/channels/FileChannel.html#map(ja
va.nio.channels.FileChannel.MapMode
,
long, long)

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Ingo R. Homann - 26 Jul 2006 07:36 GMT
Hi Jeff,

> I see your points.
> I just wanna optimize a legacy muti-jvm ( muti-processes) system, in
> which a lots of static data are stored in each process. and it will
> consume lots of memory.
> So RMI, Socket, ... is not suitable for access such lots of static
> data.

Why not? If the data is needed, it can be accessed cia the Socket.

Ciao,
Ingo
bob - 25 Jul 2006 18:54 GMT
> Since JVM is a process of OS, is there any approach to share
> data/memory between JVMs ?

Facets is a GemStone product that does this and more...
The Facets VM allows persisting any Java object transparently in a
repository that is accessed through a SharedMemoryCache.  The Facets
system provides ACID transactions to manage updates to the shared
objects.  It is scalable to hundreds of VMs concurrently accessing the
persistent data in the cache.  It can also be configured to run in a
cluster of machines with a SharedMemoryCache on each machine.

For more information see:  http://www.facetsodb.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.