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]

Similar Messages

  • Multiple JVM instances and host computer performance

    Hi,
    I was wondering if anyone has any facts or sources about how running multiple JVM instances impacts the performance of the hosting computer ?
    For example, say you have a long running server process that creates a JVM, how is the performance of the computer impacted if there are five of those processes running, versus ten versus ...
    This is a very "it depends" question, but I would like to get an idea of the baseline performance impact that comes with running a JVM, and if there is anyone here that has experience running multiple JVMs I'd appreciate any feedback, whether it's "don't do it, ever" or "no problem!"
    Thanks

    My only experience with multiple VMs is when I have several Java GUI apps (eclipse, jedit, dbvisualizer) plus tomcat and maybe an ant running on XP.
    I don't think that the existence of multiple VMs is in and of itself a problems, but JVMs do tend to be fairly memory hungry, so if you don't have a lot of RAM, you may find yourself crawling along as swapping heats up.
    I think that later versions of the Windows VM have started to take advantage of sharing certain core libraries, or pieces of them, so that you don't have as big an incremental memory footprint for additional VMs. I don't know which versions or how much this actually reduces the foot print of second and subsequent VMs though.

  • Multiple jvm/instances/auto restart

    Hi
    I have two mid tiers and both are load balanced by BigIP load balancer .
    I want to know the following
    1. How can I increase the jvm process and what is it's advantages/disadvantages ?
    2. Is it possible to set automatic restart feature in the Application server ?
    3. In some article I found that we can create multiple oc4j instance and give the same
    context root . What is the advantages/disadvantages ?
    4. Is there any feature in the app sever for monitoring like if the appserver uses more resources or crashes we can send email to the administrator ?
    Thanks,
    Suneesh

    Hello,
    My answer is based on the fact that you are using OracleAS 10g (R1, 2 or 3) -which one are you using?-
    OPMN: Oracle Process Management and Notification is the service in charge of starting and monitor the status of a process such as OC4J and its related JVM. Take a look to the OPMN documentation of your release. (and Administration Guide)
    To have multiple OC4J that use the same context root (same application deployed) you need to have an instance with cluster enabled for several process of the same instance. Take a look to the deployment and configuration guide of your App server version.
    OPMN, Clustering, and Oracle Deployment guides will answer the 4 questions you have.
    Regards
    Tugdual Grall

  • Multiple JVm instances error in iplanet 4.1

    the error message is :
    info ( 1184): JVM instance has already been created within the process, numVMs=1
    I have an NSAPI filter which uses JNI and will create an individual JavaVM.
    I understand in the process no more than 1 JavaVM shall be initialized yet I can't find a way to attach my NSAPI filter to the JavaVM created by the iplanet server.
    Does anybody has any idea how to solve this?

    Thanks for your reply. It seems odd though that IWS 4.1 seems to work fine w/sdk1.4.1 on my WinNT machine???

  • Multiple JVM instances stop simultaneously.

    We have a customer running JRE 1.5.0_8 on a Windows 2003 Server.
    We have multiple java applications running in the background on this server. We keep having an intermittent problem where all of these java applications shutdown at the same time (I'm talking within the same second). It apparently is somewhat of a clean shutdown because our shutdown hooks are running; however, these programs should not be stopping. There are no dumps being created by the JVM. It happened twice yesterday, but the day before did not happen at all.
    These applications are spawned into the background by a windows service we wrote and this same service will restart the application automatically when they stop in this fashion so the customer really has not noticed. Sometimes when the applications are restarted, they will stop immediately and our service will start them again and they stay running.
    We have logs running on these applications and there is nothing in these logs that would suggest the applications should shutdown.
    These same applications are used at other customers' sites and we do not have this problem. This is; however, the only site running 1.5.0_8, all of the others are running previous versions of the JRE.
    I do not know what kind of Windows patches has been installed by the client.

    ping

  • Multiple JVMs foe One WL6.1 instance

    Hi,
    Is it possible to attach multiple JVMs to an instance of WLS6.1
    so that all JVMs will be self sufficient in serving client requests....
    If it is possible then any pointers in that direction..???
    regards
    aseem

    Each WL server runs in one JVM. If you want to have 4 JVMs, then run 4 WL
    servers in one cluster.
    "Aseem Rastogi" <[email protected]> wrote in message
    news:[email protected]..
    currently our App runs on 2 Iplanet App Server ( they are in Cluster)
    and each App server has 2 VMs so we we are getting the feel of 4independent
    App Servers but Physically we are able to get away with only 2 boxes.
    We want to achive the same thing in Weblogic...
    thanx
    aseem
    Michael Reiche wrote:
    1) What is your requirement?
    2) Clustering.
    "Aseem Rastogi" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    Is it possible to attach multiple JVMs to an instance of WLS6.1
    so that all JVMs will be self sufficient in serving client
    requests....
    >>>
    If it is possible then any pointers in that direction..???
    regards
    aseem

  • Load balancing HTTP requests for an OC4J instance w/multiple JVMs

    Hello everyone,
    I am using OAS 10.1.3.1 and wish to load balance HTTP requests across an OC4J group of one or more OC4J instances, where each like named OC4J instance may have multiple JVMs or it may just have one JVM.
    My mod_oc4j.conf file would contain the following directives :
    Oc4jSelectMethod roundrobin:local
    Oc4jRoutingMode Static
    Oc4JMount /xyz/* xyz
    In the degenerate case, I would like to have an OC4J group with a cluster size of one, and have that one OC4J instance have two or more JVMs. I would like to be able to receive a request within my web application, determine that the JVM that has been sent the request is the wrong JVM to process the request, and then call HttpServletResponse.sendRedirect("/xyz"). Then, when the browser receives the HTTP 302 response and issues the subsequent HTTP request, have that request sent to a different JVM than the previous JVM that issued the sendRedirect().
    What I have seen is that the subsequent request is sent back to the same JVM that issued the sendRedirect(). I also call invalidate() against the HttpSession prior to calling sendRedirect(), but that does not seem to affect the behavior that I see.
    In the full blown case, I would have an OC4J group with a cluster size > 1, and each of those OC4J instances would have at least one JVM. In that case, I wish the sendRedirect() call to allow the subsequent request to be sent to any one of the OC4J instances in the group, and any one of those JVMs within all of those OC4J instances.
    Can anyone verify that my mod_oc4j mount directive is appropriate given the select method and routing mode? What else might I need to do to have a chance to have a different JVM respond to the request that results from a sendRedirect()?
    Thank you,
    Doug

    I should clarify that in the full blown environment, the OC4J instances that form a group will each be housed within a separate OAS instance that resides on its own machine.
    So ideally, a request could be inbound to say OAS instance 1 on machine A, OC4J instance AA, JVM 2, and I need to force a redirect so that the request can actually be serviced by OAS instance 3 on machine C, OC4J instance AA, JVM 1, and I need to be able to call sendRedirect() against an HttpServletResponse from within a JVM until the subsequent request from the browser, Internet Explorer in my case, is serviced by that JVM.
    Thanks,
    Doug

  • Ensuring one singleton instance for multiple JVMs

    i am creating a singleton object. But singleton is per JVM (or rather per classloader) right? But i want to ensure only one instance of my singleton even if there are multiple jvms....how can i achieve that?

    javanewbie80 wrote:
    i am creating a singleton object. But singleton is per JVM (or rather per classloader) right? But i want to ensure only one instance of my singleton even if there are multiple jvms....how can i achieve that?You can't.
    Given computers A and B. Neither have any connectivity by any means to the other.
    Install the application on both and run it. There is no way for either application to know about the other thus only one of the following is possible.
    1. Both applications run and create an instance. Then there are two instances and thus it fails.
    2 The application refuses to run. Then there are none and thus it fails
    Other solutions are possible given that some reasonable requirements based on actual business driven needs are presented.

  • Multiple JVMs within app server - refresh of metdata not working

    Hi guys.
    We have an interesting scenario at present when running our application within a new test environment.
    Our web-based application has the facility to refresh it's application metadata. This should mean that the next time the browser refreshes (or a user logs in to the application), the application will display based upon the refreshed metadata structure.
    Previously, we have run our application on an app server with a single JVM without any dramas. ie. the refresh has always been reflected appropriately when viewing the application - as mentioned above.
    However, we have installed the application in a new environment where the refreshing of meta data does not work consistently. That is, only about 50% of the time does the data refresh correctly. This can be seen by pressing the refresh button in an IE browser, so that the refreshed data appears approx. every second time the button is pressed. The only notable difference with this environment is that it runs 2 JVMs within the app server.
    It seems that in this case, the 'old' data remains cached for the 'other' JVM, and that when the browser receives 'refreshed' data from the server, it does not always source from the same JVM.
    This situation can be resolved by restarting the OC4J container, but this is not a desireable solution.
    Is anyone aware of an OC4J parameter that can be set so that the 2 JVMs can run in synch so that both are refreshed appropriately when our meta data is cleared (refreshed) ? I don't believe this can be controlled within the Java source code, but I'm receptive to any other alternate solutions.
    Thanks in advance.
    Steve.

    I'd like to embed multiple instances of the JVM within
    a single, multi-threaded native server process. I'm
    aware this was not possible with the Sun JDK in the
    past.
    Is this still true (for JDK 1.4.1 say)?Yes, this is still true.
    If it's still not possible, are there any timetables
    as of when it might be available? No.
    Likelihood?Check the current list of JSRs at http://www.jcp.org.
    Ah, btw: Is support for VM unloading (during
    DestroyJavaVM()) available now?No.
    >
    In any case: does anybody know of a JVM
    implementation
    available for Linux which supports multiple VM
    instances within a single process?Why do you need multiple VMs? Would multiple separate 'processes' within a single VM work? If so, have a look at:
    http://www.cs.utah.edu/flux/janos/janosvm.html
    http://www.javagroup.org/echidna/
    Jim S.

  • Server, Multiple JVMs sources

    Hi,
    i've to create a (web serivce) server application. This application should be ready for clustering or something, if one server isn't fast enough.
    I know already some things abou concurrency in Java. I'm no Java newbie. But i don't know how clustering works.
    Does it depend on the used JVM?
    Or is this for every server (i.e. Tomcat, JBOSS, ...) different?
    What are the requirements in the webservice-layer and in the persistance layer?
    Any good internet pages/PDFs which discusses this?
    Any good books?
    I really hope some can help me here, because it's very important for me.
    Cheers,
    Ingo

    I just re-read the guidelines for a clustered web app over the weekend, so I think I've got things straight. Your application will have to be sensitive to two important issues:
    1) A class which was previously a singleton may now be instantiated in multiple JVMs. The most obvious side effect of this is that the init() method of any servlet will have a different ServletConfig object passed to it for each JVM it is initialized in. As a result, the application context is no longer a valid place to store information, since the change to the application context is not necessarily propagated to the other JVMs. However, context-params will still be available from all JVMs. Another noticable side-effect is that static variables no longer work as expected (since there may be multiple instances of the same class).
    2) The HttpSession object for a given session can only be in existence on one JVM at a time. If the HttpSession needs to migrate to another JVM, then it will be serialized and sent to the other JVM. As a result, adding an object to a session that is not Serializable may result in IllegalArgumentException being thrown. I'm guessing that in the case of a fail-over (node dies unexepectedly) that the HttpSession object is lost.
    Brian

  • Multiple JVM's in one JDK

    Hi,
    I am curious to know if one JDK spawning multiple JVM's cause any memory/performance issues. The reason being, my company is planning to have number of applications running in one Weblogic Server instance with Multiple JVM's spawning out of same JDK.
    Please let me know if this is possible and if there are any negative effects of following this approach.
    Any help is greatly Appreciated.
    Thanks

    JDK installation is a just binary. There is not limit on creating number of JVM runtime process.
    There should not be negative effect assuming you have enough capacity on hardware box.

  • Running Multiple JVM's on same Server has OutOfMemory - PermGen Errors

    I have a scenario where I have 2 application servers. One is running one JVM and the other is running multiple JVMs.
    Both are configured with:
    -XX:+UseConcMarkSweepGC
    -XX:+UseParNewGC
    -XX:MaxPermSize=256m
    -XX:+CMSPermGenSweepingEnabled
    -XX:+CMSClassUnloadingEnabled
    The server that is running with only 1 JVM runs stable, however the server that is running multiple JVMs has frequent crashes due to OutOfMemory - PermGen errors. The only other difference is the Heap size. 512mb for each JVM on the app server with multiple instances and 1GB for the server with 1 instance. Is there a relationship/settings that need to be tuned when running multiple JVM's on the same server to avoid this?
    Thx

    The only other difference is the Heap size. 512mb for each JVM on the app server with multiple instances and 1GB for the server with 1 instance.This isn't a trivial difference. Basically you're saying "When I give the server 1 GB then it's okay but when I give it 512 MB it's not okay." If I saw those symptoms I would take them at face value to start with.
    So, turn off one of those servers on the machine that has two. Don't change anything else. Testable prediction: That won't fix your problem.

  • Java client connecting to multiple weblogic instances

    We have a standalone java client JMS application that needs to connect to multiple
    Weblogic instances running in different domains.
    The client works fine when we obtain an initial context to the multiple instances
    without specifying a security principle and password. As soon as we add in this
    information, we get problems: The initial context is still successfully retrieved
    for each of the weblogic instances, but we cannot send JMS messages to destinations
    on one of the Weblogic instances due to a security exception which states that
    there is an 'Invalid Principal'.
    Any advice would be appreciated.

    You should first establish a trust relationship between your Weblogic
    servers:
    http://e-docs.bea.com/wls/docs70/secmanage/domain.html#1171534
    It is very poorly documented since this is a change in the behavior with
    previous versions and should have been in the Release Notes but instead
    is inside the normal documentation.
    --dejan
    jonathan wrote:
    Thanks Arvind, but both JVMs are the same (1.3.1) and there is no jsse stuff in
    the classpath.
    "Arvind Gudipati" <[email protected]> wrote:
    check if yr client's jvm version is the same as server's jvm.. ive noticed
    this problem a few times when i was using client jvm (1.4.x) connecting
    to
    server jvm (1.3.x).. also check if u have any jsse libraries in yr
    classpath.. if so remove 'em
    +arvind
    "Jonathan" <[email protected]> wrote in message
    news:3f2f9f19$[email protected]..
    We have a standalone java client JMS application that needs to connect
    to
    multiple
    Weblogic instances running in different domains.
    The client works fine when we obtain an initial context to the multiple
    instances
    without specifying a security principle and password. As soon as we
    add in
    this
    information, we get problems: The initial context is still successfully
    retrieved
    for each of the weblogic instances, but we cannot send JMS messages
    to
    destinations
    on one of the Weblogic instances due to a security exception which
    states
    that
    there is an 'Invalid Principal'.
    Any advice would be appreciated.

  • Singletons across multiple JVMs

    I have an EJB application container which is spread across multiple JVMs(something like a clustered EJB container). I am using a Singleton class to hand out 'running serial numbers'. Therefore there is a Singleton class per JVM(which is not very clean but i chose this path in the absence of anything better). Each singleton comes up when it is first invoked within a JVM and reads a starting running number and a pool of numbers from the database. This way multiple Singletons will not step on each other when doling out the serial numbers and there is no need to go back to the database for every request to the 'running serial number'.
    Is there some way to do some of the initialization within these Singleton's just ONCE across the multiple instances of the JVM ie. a real Singleton across multiple JVMs?
    Thanks
    Ramdas

    Pranav,
    thanks for your suggestions.
    the idea of using a Session bean to access a serialized object was one of my design options when i first implemented this, but then i decided against it because of the overhead of having to make an RMI call for every request to the 'running serial number'. The application being written is for a performance benchmark, and the request to the number being done at least once for every transaction, I chose to use Singletons.
    It is a clustered EJB container(not like most conatiners), in the sense that a single container is spread across multiple JVMs.
    Now if your application is getting clustured
    then you have a problem, in that what you can do is
    what object you have made put it in JNDI context and
    everytime you want to edit it pull it out edit and set
    it back. This will act a your singleton object in
    clustured environment accross JVM'sI did not fully understand the second part of your solution????
    Ramdas

  • Single Process Multiple JVM

    What are the possible ways of emboding multiple JVMs to a single java process.
    Please post good articles if any. I have searched in google. But I couldnt get much. My requirement is to know how the heap ,stack, and inter JVM communication occures.
    I have seen many applications like Quartz/OpenSymphony runs like multiple JVMs on single process.
    thanks
    Renjith.

    Hi,
    Declare the JavaVM *jvm instance as static... so u can get the jvm using JNI_GetCreatedJavaVMs during the next time                                                                                                                                                                                                                                               

Maybe you are looking for