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...

Similar Messages

  • 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?

  • 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

  • 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

  • Running 2 java apps means 2 JVM instances ?

    For each running Java application I start on my desktop do I get a seperate instance of the JVM ? If so that seems like such a waste ...

    Yes. If you find this wasteful, though, you could write a Java application that runs your applications in a single JVM, in separate threads, but that would be violating the first two rules of optimization:
    1. Don't do it.
    2. Don't do it yet.
    Those rules are there to remind you not to try to optimize a situation until you know that it needs to be optimized and until you know how to optimize it.

  • 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

  • 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.

  • To change the JDBC driver for a single OC4J instance

    Hello,
    I implemeted an app with oracle adf (Jdeveloper 10.1.2 ) and it use Oracle Domain objects.
    I have an oas 10g (9.04.1) in windows
    and I want to change the default jdbc driver for a single oc4j instance
    in metalink i found the following information:
    1.- From OTN, download and copy the 10.1.0.x JDBC driver to a directory on the server. E.g OH/newjdbc
    2.- Opening EM-Website, navigate to the OC4J instance that should be altered.
    3.- Find the "Java-Options" and, add the -Xbootclasspath option to it, pointing to the new JDBC driver.
    E.g. -Xbootclasspath/p:$OH/newjdbc/ojdbc14.jar
    4.- Restart the OC4J instance
    my 'Java-optios' default is
    -server -Xrs -Djava.security.policy=C:\oracle\904\j2ee\test_adf\config\java2.policy -Djava.awt.headless=true
    my new 'Java optios' now is
    -server -Xrs -Djava.security.policy=C:\oracle\904\j2ee\test_adf\config\java2.policy -Djava.awt.headless=true -Xbootclasspath/p = D:\jdev1012\jdbc\lib\classes12.jar
    is this correct?
    now I cannot deploy my app
    Rigoberto

    Seems you missed something in step 3. From those steps the driver should be installed under C:\oracle\904\newjdbc and used in classpath, not d:\jdev1012.

  • Calling a method in another JVM instance

    I know you can use RMI to call the methods from classes across the network, but if the class is on the same machine, just in another JVM instance, is there a way to bypass the network layer and have the JVMs communicate directly with each other?

    Its not so much the overhead, as having the
    flexibility, to not have to modify firewall rules
    which disallow loop back traffic and most other non
    http (port 80) traffic if the production server is
    set up that way.You're coding to interfaces anyway, have a factory return either an RMI object which does the actual RMI work, or just a vanilla one if you're just running locally. As far as I know, there isn't a way to entirely circumvent the socket layer with RMI. Anyone know any different?

  • Max size of Azure table used in single ISS instance

    Hi,
    what is max size of an Azure Table used in a single
    ISS instance?
    Regards

    Hi,
    Please have a check on the below links.
    http://blogs.msdn.com/b/avkashchauhan/archive/2011/11/30/how-the-size-of-an-entity-is-caclulated-in-windows-azure-table-storage.aspx
    http://blogs.msdn.com/b/windowsazurestorage/archive/2010/07/09/understanding-windows-azure-storage-billing-bandwidth-transactions-and-capacity.aspx
    http://msdn.microsoft.com/en-us/library/azure/jj553018.aspx
    Hope this helps.
    Regards,
    Mekh.

  • Multiple JVM instances

    Dear all,
    I am trying to create multiple JVM instances using createJavaVM(...) but I can't do it. When I try to create the second instance, the function returns an error.
    Does anybody know about getting multiple JVM instances running??
    Thanks in advance,

    Hallo,
    createJavaVM(...) trys to create a JVM in your current
    process, so I am not surprised that you get an error
    the second time round, because there is already a JVM
    in the process. If you want multiple JVMs, each needs
    to be in its own process.
    Why do you want to create more than one JVM in your
    process? The JVM is multithreadable, and you can start
    more than one thread in the JVM. Would that do what
    you want?I need multiple instances because my application needs nearly 2Gb of memory and the maximum heap I get is 1700 Mb. I think with multiple instances, I'll get it.
    Do you know about getting a bigger heap??
    >
    David Singleton
    [email protected]

  • Certain application's JVM instance

    Hello,
    I didn't really know in what section to post this thread, so I figured this was the best one. If it is in the wrong section, notify me, and I will post it in the correct section.
    I am making an application in C which requires getting the process ID of a specific JVM instance. The problem isn't getting the process ID, but it's differentiating a VM instance from another. How would I go upon doing this?
    Thanks

    Wow! Can't get much easier than that :)
    Thanks alot!
    EDIT: The application I am trying to get runs as an applet. So unfortunately, every applet prints: sun.plugin2.main.client.PluginMain
    Any ideas?

  • Configuring multiple web sites in a single OC4J instance with 10g OEM

    Hi There,
    there doesn't seem to be a way of configuring multiple web sites within a single OC4J instance using the 10g Enterprise Manager Website, so can i assume that there's some performance related issues with doing this, or is it just a case of if you want multiple web sites, configure it manually?
    We currently use 9iAS release 1 (which has been configured to use multiple web sites - with normally 1 j2ee app in each website - in a single OC4J clustered instance, using mod_proxy to forward the http requests onto oc4j), but we are looking to migrate to 10g very soon...
    The initial configuration was done by an external company, so i'm not entirely sure of the reasons why it was chosen (perhaps so that if there was a problem with a single website, it wouldn't impact all our applications)..
    Does anybody else currently use multiple *-web-site.xml's in a 9iAS release 2 or 10g in a production environment, and if so did you encounter any problems with the OEM website (assuming you configured them manually)?
    Thanks in advance,
    Andy

    Hello,
    Something like this:
    New-OWAVirtualDirectory -WebSiteName "FBA"
    Enable the Basic authentication via running the following command:
    Set-OWAVirtualDirectory -Identity "yourservername\owa (FBA)" -BasicAuthentication $true
    Restart the IIS admin service in services.msc
    Thanks,
    Simon Wu
    TechNet Community Support

  • Two BI Systems connected to a single Portal instance?

    Hello,
    Is it possible to connect more than one BI system (7.0) to a single Portal instance? What would be required to do if that's the case? Thanks in advance for any information!
    Cheers,
    Hermann

    Hi,
    It is possible to add only one BI system to a single portal instance. This is because only one system object can be defined under portal as a BI master system.
    Regards,
    Anjana

Maybe you are looking for

  • Unable to install illustrator on windows server 2008

    I keep getting error messages when trying to install the free trial of Illustrator with windows server 2008 platform. Is this not an approved OS?

  • Photo's in slideshow are broken

    When I play a slideshow, some photo's are unrecognizeable, like they are digital damaged. Other photo's appear good. I've already updated my software

  • Error Handling in IDoc

    Hi Friends,    Can anybodytell me any procedure for Idoc error Handling (Restart and Recovery) of IDocs that occured in error status. What could be be the possible ways apart from BD87.Thanks in advance for ur gr8 help!!!

  • Keeping HTML markup out of the resource bundle

    Hello, I'm using ResourceBundles along with XSLT, and an issue that I'm trying to resolve is whether I should or could keep HTML markup outside of the resources. Some of the messages that my app displays have special markup, for example. Good morning

  • Missing the entry "BI Document Repository" in KM

    Hi, I installed an nw2004s java with ep7.0. Later I deployed the components for BI via JSPM and patched all to the sp5. I want to integrate BI into the Portal to run Bex-Reports on Portal. At step "Install Repository-Manager for BI-Documents and BI-M