how to share data/memory between mutiple JVMs ?

Discussion in 'Java' started by Jeff.C, Jul 25, 2006.

  1. Jeff.C

    Jeff.C Guest

    Since JVM is a process of OS, is there any approach to share
    data/memory between JVMs ?
     
    Jeff.C, Jul 25, 2006
    #1
    1. Advertising

  2. Hi,

    Jeff.C wrote:
    > 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
     
    Ingo R. Homann, Jul 25, 2006
    #2
    1. Advertising

  3. Jeff.C

    Jeff.C Guest

    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,
    >
    > Jeff.C wrote:
    > > 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, Jul 25, 2006
    #3
  4. Jeff.C

    Jeff.C Guest

    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
    > 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,
    > >
    > > Jeff.C wrote:
    > > > 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, Jul 25, 2006
    #4
  5. On 25 Jul 2006 08:35:09 -0700, Jeff.C wrote:
    > 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

    --
    [ 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
     
    Gordon Beaton, Jul 25, 2006
    #5
  6. Gordon Beaton wrote:
    > On 25 Jul 2006 08:35:09 -0700, Jeff.C wrote:
    >> 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/...tml#map(java.nio.channels.FileChannel.MapMode,
    long, long)

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
     
    Thomas Hawtin, Jul 25, 2006
    #6
  7. Jeff.C

    bob Guest

    Jeff.C wrote:
    > 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
     
    bob, Jul 25, 2006
    #7
  8. Hi Jeff,

    Jeff.C wrote:
    > 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
     
    Ingo R. Homann, Jul 26, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris
    Replies:
    1
    Views:
    522
    =?Utf-8?B?UmljaA==?=
    Apr 29, 2005
  2. Naresh Agarwal
    Replies:
    9
    Views:
    7,670
    Brad BARCLAY
    Jan 8, 2004
  3. Replies:
    1
    Views:
    1,320
    Chris Uppal
    Jan 5, 2005
  4. Krist
    Replies:
    2
    Views:
    418
    Krist
    Feb 20, 2010
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,415
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page