2 processes in a single JVM.

Hi All,
is it possible to run more than one independent processes in a single JVM.
Thanks in Advance,

Do you mean like
java Application1
then
java Application2
You only need one JVM, but you will need two instances of it. For example, if you are using Windows you would need two DOS/Command Prompt boxes open and to start the applications in each window.
Jack573

Similar Messages

  • Multiple applications on a single JVM

    I was looking at some of the disadvantages of running multiple apps on a single JVM and then I came across this sentence which I donot totally comprehend. I guess somebody here would be able to shed some light
    JVMs tend not to scale well past four processor configurations, which limits the viability of the single-JVM model on larger machines

    It means a single JVM won't take as much advantageof
    an 8 CPU system as multiple JVMs will.Yes I understand the lingual meaning of the sentence,
    what I am struggling with is its semantic meaning.
    Why can't a single JVM take advantage of 8 processor
    r CPU? Are there any limitations associated with a
    single JVM and in case there are what could they be?If I remember correctly the inherent concurrency limitations of JVM prevent it from fully utilizing the processing power of the machine. There is a limitation to the heap size one JVM can have, no. of thread pools that could be supported so multiple JVMs provide additional heap size, multiple thread pools, each corresponding to the application associated with the JVM, thus enabling to use the extra processing power.

  • Helps!:How to start multi process in a single java program?

    I wanna to test the querying performance of a Database
    connection poll,and here,not only multi threads,but also multi process I need to start in the same java program cause i have only one PC available.....
    Does that possible?

    In pure java this is not possible.
    A java program with all its thread run in a single
    jvm,
    which is just one process.However, you can have multiple instances of the jvm, I've done it w/ I needed to test some row locking in my database app. If you are in windows and want 3 copies of you program just make a bat file that looks likejavaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClassThat will create 3 instances of the jvm and thus three instances of your application. I'm sure the same can be done on multiple platforms.
    Peter

  • Single JVM, two nodes, separate override files configuration?

    This question might have surfaced before in the forums but even after going through several posts I couldn't get a decent understanding on how this works. Here is my question...
    I wanna bring up two coherence nodes in a single JVM, both independent and unrelated to each other. These two nodes have different cache-config xml files, and also override files. My question is how do I configure these nodes such that they work with two separate override files. I don't wanna use -Dtangosol.coherence.override because my doing this, this system property applies to both the nodes so I can't keep the override xml files separate.
    So, what is best way to accomplish this such a way that the nodes don't collide with each other by using a common override files?
    I hope I am clear.
    Thank you.

    Hi,
    Both the solution I posted and Jon's solution rely on a ClassLoader to isolate the Coherence nodes within the JVM. We do not use this in Production but we do use it as part of our build process and run over 18,000 test cases with a single JVM cluster, so in that respect it works well. I think if you used it in Production you would need to have done a lot of testing to make sure that there are no very subtle issues that might come back to bite you later.
    The reason doing what you want is difficult is because Coherence uses a number of singletons at runtime - for example the Cluster instance, and without using a class loader it is difficult to have more than one of these. Coherence also uses a lot of System properties to override configuration values so these may need to be isolated too.
    Finally using a class loader would make if difficult for your application code to interact with the two isolated nodes inside the single JVM.
    It might be better if you told us why you think you need to run two nodes in a single JVM - what requirement are you trying to meet? There might be a much more sensible solution to your requirements. As NJ has suggested using Extend might be one solution but without knowing more about what you want to do I couldn't say for sure.
    If you don't know what Extend is then read the documentation - The Client Guide covers Extend http://docs.oracle.com/cd/E24290_01/coh.371/e22839/toc.htm and the rest of the documentation is here http://docs.oracle.com/cd/E24290_01/index.htm
    JK

  • Multiple Standalone Persistence Manager Servers in a single JVM?

    Greetings [Kodo 3.4.1, Oracle9i]
    I am currently working on introducing the Kodo Standalone Persistence
    Manager Server into our architecture. One issue is that our application
    accesses several different databases, each via a separate
    PersistenceManagerFactory. This would mean (I think) that I would need to
    start a separate Standalone PM Server for every database, which would mean
    about 10 different JVMs running, just for the required Standalone PM
    Servers...
    The question... Will it be possible and sensible to run multiple
    "Standalone" Persistence Manager Servers within a single JVM? The idea
    would be for me to write a threaded server, where each of my threads invokes
    kodo.jdbc.runtime.StartPersistenceManagerServer.run(someJDBCConf), where I
    provide a JDBCConfiguration for each database I want to connect to. This
    means that my server will effectively be listening for clients on several
    different ports and accessing several databases all from within the same
    JVM.
    Is this feasible? Anyone with access to the source, can you say that the
    StartPersistenceManagerServer.run() method may be safely run in several
    different threads?
    I suppose another option would be to use the HTTP Persistence Manager Server
    and then simply deploy 10 servlets, one per database... But I'm trying to
    avoid introducing a servlet container into the mix.
    Thanks
    Drew

    Hi Marcus and thanks...
    Yes, I want to use Remote Persistence Managers. Currently we have a 2-Tier
    application, but we need to introduce a 3rd tier to be able to use the
    DataCache. If we don't do this, then each running application will have
    it's own DataCache, which will not "see" changes in other running
    application DataCaches. I have tried to attach a "before" and "after"
    diagram to illustrate...
    Now if we extend this a bit further, and say that instead of just one
    database, our application actually needs to access 10 different databases
    (so 10 different PersistenceManagerFactories and 10 different DataCaches),
    then hopefully it is clear that we would then need 10 separate Standalone
    Persistence Manager Servers. I have attempted to attach another diagram to
    illustrate.
    I don't really want to start up 10 Remote PM servers, I would rather just
    have one server, which brings me back to my original question... Can I run
    them all in a single JVM?
    Cheers and thanks
    Drew

  • Running multiple java-apps in single JVM?

    We have about 125 Citrix clients running on 5 Citrix Servers. We are investigating a new very big development project which will cover about 10 main projects with 15 Applications each. The complete project will be written in Java.
    Basically, each module will have it's own JVM. BUt, when each client runs a couple of modules, the servers will surely run out of memory...
    I searched for way's to run different modules within 1 single JVM but it seems to be 'not done', because of 'System.exit()', 'Static Variable' probs to name only 2.
    Any idea's on how to implement this?
    thanks.

    thanks for the reply.
    Yes, I assume the server will run out of memory.
    1) Our citrix servers are consuming about 3/4th of their 4Gb memory capacity without any java_application running.
    2) Each of our 5 Citrix servers has 25 users active
    3) Each JVM takes about 20mb memory
    4) Each user will run at least 3 app's simultaneously
    Abouve results in 3*20=60Mb / user * 25= 1,5Gb memory extra needed.
    Can you give me an example of a Thread.sleep(60000) test_pgm?
    and/or an example for a "classloader" program to launch each app in its ow sandbox (in same JVM)?
    (eventually a link to get more info on this)
    thanks

  • How to export a whole process for a single image.

    Good morning.
    I would like to know how I can export a whole process for a single image. Is it possible? With that I can print of the way that goes better.
    Thanks.

    Hi Raghavendra,
    Thanks for answering my query. I have created a transport request and exported the folder I need to take backup of. But when I tried testing import of the same request I am getting following error. Do you have any idea what is the cause of this error?
    com.sap.security.core.server.destinations.itsam.DestinationRuntimeException: com.sap.security.core.server.destinations.api.DestinationException: [_DestinationServiceAuthorization1005] Code-based destination service access denied to component sap.com/cafeugpuiadmin. Access to security-relevant internal destination properties (e.g. passwords, tickets, etc.) is restricted to few selected engine components and not generally available to any service or application.
    Kind Regards,
    Urvashi

  • Workflow Process Name for Single/Bulk enrollment

    Hi,
    What is the Workflow Process Name for Single/Bulk enrollment through Learning Administrator ?

    Hi,
    In this process, how to enable approval flag for Learner Administrator ?
    or in other words ...
    Does approval can be set when Learner Admin enroll any employee/learner in the class ?

  • Multiple RMI servers in single JVM

    Hi,
    I have a RMI server listening to requests from internal network as well as external network. RMI returns the hostname as part of the stub. So to ensure that the subsequent RMI calls work fine I need to ensure that jama.rmi.hostname is set to correct value.
    With 2 network IPs on 1 machine (internal & external), one option was to use a domain name as hostname and set it as java.rmi.hostname. Unfortunately, my client is not allowing use of DNS. So the hostname can be set only as an IP address.
    Is there some way I can start 2 RMI servers in single JVM. While starting first one I can set hostname as internal IP and then while starting the other one I set hostname as external IP.
    Problem is I don't know if such a solution can be setup. I read somewhere that from jdk1.4, System.setProperty("java.rmi.server.hostname", "172.25.17.41"); will set hostname dynamically. So all future requests will use the latest hostname.
    Important thing is some way to make sure both networks can connect to my JVM through RMI.

    I get it, you're going down the path I hate. I have undone this so many times ... (essential when deploying RMI Proxies).
    Don't know why your intranet clients can't connect, unless it's the local binding of the server socket.
    If you must explore this horrible kludge around a Sun kludge (and overload the SF mechanism even further), you may as well go the whole hog and have the SSF corresponding to each CSF bind its ServerSocket to the local address that you're going to embed in the CSF. Then you really know who can connect and who can't.
    When writing SFs you need to think about what equality of socket factories really means. It only needs to imply that both socket factories being compared observe the same superimposed protocol (e.g. SSL), or that they both don't superimpose a protocol at all, so outbound or incoming calls really really can share the same port.
    SF equality generally doesn't need to extend as far as whether the embedded host names (in your case - ugh!) are the same, or the port numbers if you want go the whole hog and bypass the stub's remote reference info altogether.

  • Possible to set CacheSize for the single-JVM version of the data cache?

    Hi -
    I'm using Kodo 2.3.2.
    Can I set the size for the data cache when I'm using a subclass of the single-JVM version of the
    data cache? Or is this only a feature for the distributed version?
    Here are more details...
    I'm using a subclass of LocalCache so I can display the cache contents.
    The kodo.properties contains these lines:
    com.solarmetric.kodo.DataCacheClass=com.siemens.financial.jdoprototype.app.TntLocalCache
    com.solarmetric.kodo.DataCacheProperties=CacheSize=10
    When my test program starts, it displays getConfiguration().getDataCacheProperties() and the value
    is displayed as "CacheSize=10".
    But when I load 25 objects by OID and display the contents of the cache, I see that all the objects
    have been cached (not just 10). Can you shed light on this?
    Thanks,
    Les

    The actual size of the cache is a bit more complex than just the CacheSize
    setting. The CacheSize is the number of hard references to maintain in the
    cache. So, the most-recently-used 10 elements will have hard refs to them,
    and the other 15 will be moved to a SoftValueCache. Soft references are not
    garbage-collected immediately, so you might see the cache size remain at
    25 until you run out of memory. (The JVM has a good deal of flexibility in
    how it implements soft references. The theory is that soft refs should stay
    around until absolutely necessary, but many JVMs treat them the same as
    weak refs.)
    Additionally, pinning objects into the cache has an impact on the cache
    size. Pinned objects do not count against the cache size. So, if you have
    15 pinned objects, the cache size could be 25 even if there are no soft
    references being maintained.
    -Patrick
    In article <aqrpqo$rl7$[email protected]>, Les Selecky wrote:
    Hi -
    I'm using Kodo 2.3.2.
    Can I set the size for the data cache when I'm using a subclass of the single-JVM version of the
    data cache? Or is this only a feature for the distributed version?
    Here are more details...
    I'm using a subclass of LocalCache so I can display the cache contents.
    The kodo.properties contains these lines:
    com.solarmetric.kodo.DataCacheClass=com.siemens.financial.jdoprototype.app.TntLocalCache
    com.solarmetric.kodo.DataCacheProperties=CacheSize=10
    When my test program starts, it displays getConfiguration().getDataCacheProperties() and the value
    is displayed as "CacheSize=10".
    But when I load 25 objects by OID and display the contents of the cache, I see that all the objects
    have been cached (not just 10). Can you shed light on this?
    Thanks,
    Les
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • In a single JVM the objects can pass-by-value ?

    what happen when a bean call to another bean which already deployed in the same container?
    how many JVMs in a container?

    "I thought parameters were all pasted by value because Java doesn't support pointers?"
    Incorrect assumption.
    Java doesn't let you fiddle with pointers, but effectively all object variable references are pointers (not exactly though). If you are working in a single JVM all params are passed by value, but when you think you are passing objects you are really passing object references, so it is they (the object references) that are passed by value.
    Within the scope of EJB, objects (not the references) are passed by value because we are talking about remote method calls. Since calls are assumed to be between separate JVMs the object state must be copied across the wire.
    In the case of an EJB calling another within the same JVM, the parameters passed must still be passed by value since the receiving code may rightfully assume there is no shared object state (the implementation could be pass-by-ref as long as the container could somehow support the above assumption, not very likely).

  • Single JVM instance

    Is there any way to control number of JVM instances running on system. I would like some of my applikations to run in single JVM, or to have only one JVM on system which would run all of java applications?
    Milan

    I am currently trying out running programs within a single JVMs... There are many things you have to take care of�especially when using swing applications...
    Example: If you use static objects in some classes (or you use classes with static variables from the JDK) you have to use different classloaders for each program run within your JVM. This is nessessary as each program needs to have it's very own static object, but this makes the memory reduction worthless as the loaded classes are the main reason for memory consumption. (Some kind of Shareable interface, implemented by all classes not using static members would help in my opinion. But it is Sun's turn to introduce that in the JDK.)
    2nd Example: You have to be very careful to really stop a program within the JVM when it is shut down. This means to interrupt all threads (which are not part of one threadgroup, as f.e. swing and rmi use their own threadgroups), remove all Timer-Events from existing SwingTimers (or java.util.Timers), disposing all windows, and so on...
    So it is very hard to really produce a stable application when using only one JVM...

  • Master data Reorganization Process for a single InfoObject

    Hallo Experts,
    mayby someone else had  this problem bevor us?
    SAP-BWProducion: Master data Reorganization Process for a single InfoObject (selfmade), other InfoObjects worked fine.
    SAP BW 7.0 SP20 or 21
    This element has daily attributes and the Q-Table has actual 180Mio entries. We startet reorganisation with 250Mio. entries.
    Because of the daily loading, we cancel the batchprocess in the evening and started it again in the morning. This was fine for about 5 days. We elliminate 80Mio entries.
    Our destination would be 80Mio entries left.
    Whenever we run this feature now  - in a process chain - no entries were deleted after 30 hours working, and there were no counting-stastics in SM50
         Sequentielles Lesen         
         Insert                       
         Update
         Delete
    The five days before, we saw Mio's of entries in this statistics.
    We have checked the Q-table and  there exist a number of records which have the same attribute values across several records and the date from - date to values of these records are in a row.
    RSRV is fine and we checked note 1234411 Master data reorganization - Performance improvement.
    There are no other notes helping us.
    Please give us a solution-idea.
    Thanks
    Santra

    Hi Santra,
    Could you please provide the solution for this?
    Thanks
    Vinod

  • Multiple web apps sharing same cache in a single JVM ?

    Is it possible to share cache across multiple web apps running in the same app server (multiple web apps, single JVM) ?
    Thanks for any info.

    Hi Bob,
    Cluster membership is scoped to the ClassLoader, so if your application server provides a ClassLoader-per-application, this will work fine.
    This is supported for both Coherence (NamedCaches) and Coherence*Web (HTTP sessions).
    Jon Purdy
    Tangosol, Inc.

  • Multiple instances of app in a single JVM

    Hi all,
    I saw an article either on the web or in a magazine not too long ago about how to "detect" if the app is already running, and if so, it hands off the new instance to the already running JVM, which then creates a thread to run the Java app in. As it turns out, my app will be used in an ASP environment, through Citrix. We may have as many as 50 to 100 users running the same app, each with their own unique user ID, but all using the same one server to run it on. Each instance eats up 25MB of memory right now. So the question is if anybody knows of a URL or an app like this that can handle the process of running the same (or even different Java) apps in one JVM as separate threads, instead of requring several instances of the JVM to run? I know this article presented a fully working example, and I believe I know enough to do it but I wanted ot use the article as a reference to make sure it is done right. I know that each app basically would use the same one "launcher" program that would on first launch "listen" to a port, as well as send a message through the port to see if an existing launcher was running. If it does, it hands off the Java app to be run to the existing luancher application and shuts down the 2nd launching app. By using this method, the JVM eats up its normal memory, but each Java app only consumes its necessary memory as well and doesn't use up more JVM instance memory.
    Thanks.

    Anyone have any ideas on this one?

Maybe you are looking for