Jvm question

Hi. Let's say I have two computers, "apple" and "orange". They are both running the same java program called "synchronize", which is installed on both computers, and they communicate with eachother via RMI.
synchronize has two classes called "ClassA", and "NetPackage"... NetPackage is the object which is passed around on the net via RMI. NetPackage has a method called "getVersion", which has as method body "return ClassA.getVersion()", essentially a link.
If "apple" is calling NetPackage.getVersion(), then I know that I will get the version as defined in apple's jvm. However, what happens if orange gets a NetPackage from apples jvm, and from within orange's jvm we ask that remote NetPackage to getVersion(). Can I assume that this call gets sent back through the remote object to apple's jvm, which returns the version as defined in apples jvm, or does the remote object, because it is now executing in oranges jvm, return the version as defined in oranges jvm?
I hope I made my question clear enough, but I don't know any other way of describing my problem.
Thanks in advance for your help.

"...NetPackage is the object which is passed around on the net via RMI." is somewhat vague - because a cleint can retrieve either a copy of an object, or a reference to a remote object.
This depends on how the object is defined: If it is derived from UnicastRemoteObject, then it is a remote reference; otherwise a copy must have been serialized .
With respect to the "link":
o For a Unicast remote object, the method invocation will cause a call on the remote objects method, which will in turn access the other remote object.
o For a serialized object, the other object better be serializable too, in which case both objects should exist on the client computer.

Similar Messages

  • JVM questions

    Here are a few questions I need help with regarding 8i and App
    Server.
    1) What is the differences between the JVM in each product?
    2) What is the max socket connection for one JVM?
    3) What are some parameters for thread usage in a JVM? i.e.
    thread stack size, max threads per VM, are the thread native to
    Linux or green ?
    thanks, Jon
    null

    4. Whats the best way of stopping different versions of jre from being installed by admin users
    The most obvious way is the best. Give admin accounts only to those users who know what they are doing. That's not really a Java question.

  • Solaris JVM question

    Hi,
    I am a newbie on Solaris and have found that there is a significant degredation in performance when my java application is run on a Solaris JVM as opposed to a Windows JVM.
    I'm running with the -server option which has helped, but was wondering if there is some other tuning that I could do in order to make the HotSpot JVM as fast as possible.
    Thanks,
    Tom

    Check your JVM settings, they make a lot of difference to the performance. It also depends on the load you have on the system. Windows does not do as well when compared with Sun when there is a high load.

  • Fine tuning GC

    Hi folks,
    Hi folks,
    I posted this question to Java Programming before, but I think it should be a JVM question.
    I have a web server that has 16GB of ram. Currently, I only allocate 8GB to the Java heap. The server is doing fine now, but I am worried I need to allocate more memory to the Java when we get more users.
    When a normal user sign in, it will require a 30MB data structure. The data will be saved in the session. The data will be removed from session when the user logs out or session times out. For some users, the data structure may require 1GB to build, but those users are not too many. The problem is, there may be a chance few of these large users log in and many of the normal users are still in session. It can totally bring the server down. My plan is to put 32GB of ram to the server, and allocate 3/4 which is 24GB to the Java heap.
    Okay, here is my question, when the JVM needs to the major or full GC for 24GB, the pauses will be long. I wonder if there is a way to tune the GC to do the major or full GC around 8GB like before even I allocate 24GB.
    Thanks in advance!

    Only reason I could see to keep session info like that in memory would be a milsec app. If that is your app then get a box with a lot of memory. If isn't then redesign it.

  • JBO-26031 URGENT

    we wrote a bc4j-jsp application. we deployed it on oc4js (shipped with jdev903), which runs on a windows server and on a linux server and everything works fine.
    now we deployed it on a aix 4.3 (jdk 1.3.1, Maintenance level: 4330-09) and we got following error:
    JBO-26031: Assocation end EmsBren of assoc ExeBstFkAssoc invalid for entity base EmsBrenExt in view object EmsExtView.
    this exception occurs while inserting or updating a row.
    we have checked the bc4js (the xml files), they seems to be correct.
    there are also some strange things occuring while using oc4j on aix (compiler error after restarting oc4j), but the above exception is a large problem for us.
    does anybody know, what4s wrong? is it possible, that the jdk is the problem?

    Andre -- We do not recommend that you use OC4J extracted from a JDeveloper installation. It is not supported. You should use the standalone OC4J available from OTN. As for your JVM question, I am not familiar with AIX but you could look at the Oracle9iAS v903 installation guide for AIX (http://otn.oracle.com/docs/products/ias/doc_library/903doc_otn/unix.903/install/toc.htm) and that should give you the information that you need. Lastly, if you are still having BC4J issues I would ask your question on the JDeveloper forum (http://forums.oracle.com/forums/forum.jsp?id=315684) BC4J is discussed under the JDeveloper forum.
    Thanks -- Jeff

  • OC4J10g DP3 with JRockit1.4.2.05

    Report.
    Product :
    0C4J 10g (10.1.3) Developer Preview 3 (build 041121)
    JVM :
    java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
    BEA WebLogic JRockit(TM) 1.4.2_05 JVM R24.4.0-1 (build ari-38120-20041118-1131-win-ia32, Native Threads, GC strategy: parallel)
    Note :
    The last version of 0C4J 10g (10.1.3) work fine with this version of JVM
    Question :
    Do you support for 10.1.3 this JVM ...
    Error :
    OC4J startup failed
    java.lang.ClassCastException: java.lang.Class
    at oracle.oc4j.loader.ClassLoaderQuery.getLoadedClasses(Ljava.lang.ClassLoader;)Ljava.util.List;(ClassLoaderQuer
    y.java:863)
    at oracle.oc4j.loader.boot.BootStrap.transferBootClasses(Loracle.oc4j.loader.SharedCodeSource;)V(BootStrap.java:
    891)
    at oracle.oc4j.loader.boot.BootStrap.populateLoaders(Loracle.oc4j.loader.boot.BootConfiguration;)Loracle.oc4j.lo
    ader.boot.MainClass;(BootStrap.java:491)
    at oracle.oc4j.loader.boot.BootStrap.initLoaders(Loracle.oc4j.loader.boot.BootConfiguration;)Loracle.oc4j.loader
    .boot.MainClass;(BootStrap.java:320)
    at oracle.oc4j.loader.boot.BootStrap.createBootEnvironment(Loracle.oc4j.loader.boot.BootConfiguration;)Loracle.o
    c4j.loader.boot.MainClass;(BootStrap.java:284)
    at oracle.oc4j.loader.boot.BootStrap.main([Ljava.lang.String;)V(BootStrap.java:216)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi Jaime,
    This is a known issue in the OC4J 10g (10.1.3) Developer Preview 3.
    This will be solved in the production release.
    Regards
    Tugdual Grall

  • Using static variables in ejb

    I'm interested in the rule from the EJB spec:
    � An enterprise bean must not use read/write static fields. Using read-only static fields is
    allowed. Therefore, it is recommended that all static fields in the enterprise bean class be
    declared as final.
    This rule is required to ensure consistent runtime semantics because while some EJB containers may
    use a single JVM to execute all enterprise bean�s instances, others may distribute the instances across
    multiple JVMs.
    question 1
    Can you call "Math.random();" in ejb code???
    The javadoc for this method says
    When this method is first called, it creates a single new
    * pseudorandom-number generator
    This means that you can't use it right?
    This is not a problem for me, I know that you can go (new Random()).nextDouble();
    What I'm interested in is, does the EJB spec permit use of this method, and how are you supposed to know when you're breaking the spec like this.
    question 2:
    how about if you have a class
    class MyClass{
    public static final ArrayList MY_LIST = new Arraylist();
    Surely you can't read and write to MY_LIST from EJB's cause you're breaking the rule.
    But at what point are you actually breaking the rule?
    Can anyone out there spell this out for me??

    � An enterprise bean must not use read/write static fields. Using read-only static fields is
    allowed. Therefore, it is recommended that all static fields in the enterprise bean class be
    declared as final.
    Note that the rule covers usage of ALL static fields, not just fields on the implementation class.
    If I use
    MYBeanStaticVariableHolder.myStaticVariable
    for read/write.
    I understand that it's not a good idea, and I would never do it.
    But, does it actually break the spec. yes or no!!! - YES
    If yes, then fine I'm happy, what about my Math.random() question?
    Can you call "Math.random();" in ejb code???
    Math.random() is effectively read-only, because you never write to the result returned and therefore does not break the rule, so calling Math.random() would be allowed.
    how about if you have a class
    class MyClass{
    public static final ArrayList MY_LIST = new Arraylist();
    Surely you can't read and write to MY_LIST from EJB's cause you're breaking the rule.
    But at what point are you actually breaking the rule?
    Can anyone out there spell this out for me??
    If you write to a static field, update the state of an object in a static field, or update the state of an object returned by a static method, when the method does not return a unique instance at each invocation, you are breaking the spec
    public class Sample
        public static final int START_MODE = 0;    // OK
        public static final int STOP_MODE = 1;      // OK
        public static int DEFAULT_MODE;           // updating this is BAD
        private int currentMode;
        public int getMode(){ return currentMode; }
        public void setMode(int mode){ currentMode = mode; }
        // Updating instance is BAD
        public static Sample instance = null;
        // Updating returned instance is BAD
        public synchronized static getInstance()
            if( instance == null ) instance = new Sample();
            return instance;
        // Updating returned instance is OK
        public synchronized static getUniqueInstance()
            Sample instance = new Sample();
            instance.setMode(Sample.MODE_START);
            return new Sample();
    }Hope that helps.

  • Question regarding Applet and JVM

    Hi all!
    I'm working on an applet now and it's been working quite fine, just that when I run the same applet on different tab in a single browser window, it'll get some error.
    But if I run the applets in different windows, it'll be fine.
    So I'd like to know how does JVM handle the execution of applet?
    What is the difference between:
    - how JVM handles multiple applet in different-tab-in-single-browser and
    - how JVM handles multiple applet in different browser?
    Any help is greatly appreciated :)
    Thanks in advance ^^

    Sounds like you're using static fields. Not a good idea in applets because...
    What is the difference between:
    - how JVM handles multiple applet in different-tab-in-single-browser and
    - how JVM handles multiple applet in different browser?
    ...that's entirely up to the browser. Actually, your question's slightly misconstrued. What you should really ask is,
    What is the difference between:
    - how the browser spawns JVMs in different-tab-in-single-browser and
    - how the browser spawns JVMs in different browser?
    Either way, it's out of your hands. Which is why you're going to have to be very careful about using statics: if you use them for state information then another applet can trash them; if you use them for inter-applet communication you might not reach one applet from another.

  • Simple Question Calling methods from Java files through JSP without JVM

    Hi.
    I've got a simple question (forigve my newbieness)...
    If I'm running Tomcat can I exectue a method in a compiled Java file from a JSP page without having the JVM installed on the server?
    Any thoughts or additional comments would be appreciated.
    Many thanks.

    No... but that's because you can't run Tomcat without
    a JVM installed on the server.
    If you are running Tomcat, you are running a JVM for
    the JSP pages to run in, in which case, yes, the JSP
    pages can call the other Java code... as long as it's
    in the classpath.Thanks a lot for the replies.
    So just to check, if I sign up with a hosting company that offers Tomcat then the JVM will be installed on the server and I can call other Java code as long as it's in the classpath?
    I just want to make sure before I sign up with a hosting company =D
    Thanks again!

  • Basic questions - Instances in JVM

    Hello Members,
    I am using java 1.6 in my personal computer and I got a very basic query in java.
    Till this time i was thing that there will be only one JVM would be there in my PC, which came along with the JDK1.6.Please correct me if i am wrong.
    The reason why i got this doubt is because if im creating a singleton class in java in one of the workspace in eclipse,then there will a single object instance active in JVM. Can i able to access the same object from the other workspace since there must be only one JVM in my PC..
    Assume workspace1 where i have created a singleton class called UserModel.java, i executed this class and if I try invoking the same singleton class from another workspace workspace2,will i get the same object in this workspace has the class is a singleton?
    Similarly all the application server which are installed in my PC will share the same JVM right?
    example the same singleton class if i deploy in jboss and execute an instance will get created in jvm.If i try running the same class again with Apache Tomcat will i get the same object instance in the JVM?
    Please clear my doubts...im getting confusion alot.I am very thankful for the answers.
    Thanks
    Manoj

    802963 wrote:
    Thank you Jverd for your valuable info.
    I got one thing clear none of the app will share a same object even though a copy of the same app is executed again. But i wud like to know how many JVM will be there in the system or the single jvm will process every execution as a separate entity?Every time you run the java executable, that's a separate JVM.
    Im trying to create a plugin for the eclipse, which just creat a junit test case on the right click of the java file for the business logic in the class. In that plugin I have a model class which is a singleton where i ll be setting the class name,method name and parameters in the method.
    When i tried to use those singleton model class in the other java file(out of plugin) im getting the new instance with all information like class name,method name and params are null.That sounds like more of an eclipse question than a Java one.

  • Jvm specification . The questions again !!!

    hello professor.
    Iam new to the field of robotics and embedded system design and programming i need to know some basic informations from you .
    first i had developed some microcontrollers from microchip in basic (picbasic Pro) compiler and some assembly coding.
    but i saw some companies like
    http://www.ridgesoft.com
    made an environment (Editor) that i can develop their own microcontrollers like Intellibrain and Sumoii in java and this editor which is called roboJDE gives me the following facilities:
    1) i can program writing java code syntax using their own packages && classes for some serial and hardware programming like accessing pins && EEProm and alot of these things in java and then my project compiled into .class file containing the bytecode and also .hex file containing INTEL HEX representation of my code of java then i can use any programmer software to feed this .hex file into the microcontroller itself without running any jvm inside the hardware of the microcontroller itself.
    my question here is :
    A) How can i convert my java project into (.hex file that represent my java code ) specific for the instruction set of microchip microcontrollers family of 16F8X microcontrollers?
    B) i want to design my own jvm to run on 16F8X family to accept files .class containing the bytecode directly . What are the requirements for me to design this specific jvm for these microcontrollers family of microchip according to their instruction sets?
    Knowing :
    I had read (java virtual machine specification second edition) which is called the blue book ,
    But i still don't know From where can i begin and what tools i must have to begin programming this jvm to install it into the microcontroller to accept bytecode file .class directly ?????
    Thanks
    Yours;
    Snouto;

    EJP wrote:
    Buy the book. If the specification is critical for your work you're crazy to rely on an online source.True as it might be, it actually looks like Oracle seriously broke some of the references on their own site. For example http://www.oracle.com/technetwork/java/javase/documentation/whitepapers-jsp-139357.html is pointing to http://java.sun.com/docs/books/jls/index.html which results in 'Sorry! We couldn't find your document.'
    To the OP: googling for Java virtual machine specification lead to enough sites providing the book as an online resource or as an ebook.

  • JVM Version question

    Sorry for what might seem a really random question!
    At work, we're using a software audit tool which lets us know all the .exes and .coms, etc which are installed on the PC's in our estate...
    We need to know what version of JVM is installed on these PC's - does anyone know whether you can determine this by looking at the files on a machine? For example, is there an .exe (maybe of a particular filesize) that would point to the fact that a particular JVM is installed???
    Does this make sense?

    I assume you work on Windows.
    If you want to know which VM is installed by suns means you can look in the Registry in
    HKLM\SOFTWARE\JavaSoft\Java Development Kit or HKLM\SOFTWARE\JavaSoft\Java Runtime Environment
    see http://java.sun.com/j2se/1.4.2/runtime_win32.html
    Or if you want to search for a recource description look at the jvm.dll in %JRE_HOME%\bin\client\jvm.dll (client vm) %JRE_HOME%\bin\server\jvm.dll (server vm) . The fileversion should match the version of the jvm (java -version).
    Note that in an JDK installation the JRE_HOME is in %JAVA_HOME%\jre where JAVA_HOME is the directory where the jvm is installed.
    The safest way would be to tell your tool to search for jvm.dll and the fileversion entry. For j2sdk 1.4.2_05 it is 1.4.2.50
    This is true for 1.4.2 my installations.
    I found that in all installations the rt.jar in the lib dir of the JRE contains in his Manifestfile the implementation-version of the installed JVM. This means look at the META-INF dir in the rt.jar (Zip-File)
    and open the MANIFEST.MF and look at the tag Implementation-Version. (e.g. Implementation-Version: 1.4.2_05)
    I have not found more to identify the vm. The safest is to call java -version.

  • Question on Verbose GC output - JVM 1.5 on Solaris

    Hi,
    I noticed quite a few instances of the following lines in verbose gc file before the garbage collection. The output snippet is pasted below.
    Application time: 4.1012270 seconds
    Total time for which application threads were stopped: 0.0005752 seconds
    Application time: 0.8841404 seconds
    Total time for which application threads were stopped: 0.0032039 seconds
    Application time: 0.4440765 seconds
    Total time for which application threads were stopped: 0.0007130 seconds
    Application time: 1.6186331 seconds
    Total time for which application threads were stopped: 0.0008264 seconds
    Application time: 0.4347317 seconds
    Total time for which application threads were stopped: 0.0033167 seconds
    Application time: 0.5889457 seconds
    Total time for which application threads were stopped: 0.0009594 seconds
    Application time: 1.6823893 seconds
    Total time for which application threads were stopped: 0.0024016 seconds
    Application time: 0.3524678 seconds
    Total time for which application threads were stopped: 0.0463151 seconds
    Application time: 0.4329528 seconds
    Total time for which application threads were stopped: 0.0013379 seconds
    Application time: 1.2358984 seconds
    49.720: [GC 49.721: [ParNew: 306688K->0K(306944K), 0.1254446 secs] 306688K->16332K(1023744K), 0.1258293 secs]
    Total time for which application threads were stopped: 0.1299930 seconds
    Application time: 0.3679377 seconds
    It is my understanding that this information is printed at the end of execution of any VM operation that requires stopping of all application threads (thread dumps, heap dumps, finding deadlock and GC). I do not find any heap dumps or thread dump on the server.
    How can I find what is going on the server ? The fact it is occuring every second is what I am worried about.
    The server is WebSphere 6.1 running on Solaris.JVM is 1.5.
    Thank you for reading this post.
    Vasu

    you normally take thread dumps and heap dumps and analyze where the memory leaks are or what objects are bloated... the tools your would use are eclipse mat (memory analyzer) or/and jconsole wud be good.

  • Question on Static keyword  design with JVM

    hi
    how jvm identify this one is static and other is non-static, if it identifies by using any keyword what is that? see, don't tell by static word. To identify that static, what is implemented in jvm?

    DrClap wrote:
    jverd wrote:
    ejp wrote:
    At an educated guess, they are both set by the associated subsystems if the corresponding item was declared static, and not otherwise.
    Were you expecting something different?I was hoping it was magic bunnies.I use that hypothesis all the time. Garbage collection? Done by magic bunnies. JIT compiling? Those magic bunnies again. As long as they keep doing their magic, I'm happy because I can get real work done.I tell our junior developers that it is all done by the random effect of gamma rays. I leave out the part about man-in-the-moon marigolds because I don't want Paul Zindel to sue me.
    ¦ {Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • JVM Heap question -

    Hi,
    I have two question related to Java Heap on J2EE 7.0.
    First Question-
    The NewSize and MaxNewSize parameters control the new generation's minimum and maximum size. There is another parameter called NewRatio, which conntrols the ratio of old to young generation. I presume that young and new generation are same thing.
    My question is that do I have to set only NewRatio or I have to set NewSize and MaxNewSize  as well to control the size of the new generation. If I set all three than which one will supercede what. OR NewSize and MaxNewSize  is just a cap so it does go above this value even if the ratio ment to be little higher for young generation.
    Second Question -
    I have 10GB RAM on out J2EE host PI 7.0. I have only one server. The server heap is set to 2048 in configtool. Both -Xms and -Xmx are same. This is on AIX. When I check my host at UNIX then I always see free memory. I have read that one server0 should have 8GB.
    My question is that do I need to increase the -Xms and -Xmx sizes and what is the relationship of heap with RAM. I am limiting the heap to 2048. Both old and young will limited within this heap. Like in ABAP we have RAM then extended and then heap per/session and extended per/session. Is there anything like this in J2EE.
    I am very confused.
    Please help me.
    SC

    Hi,
    To your first question:
    In Java 1.3, NewRatio is superseded by MaxNewSize's defaults (rendering NewRatio ineffective for even moderately sized heaps).
    In 1.4 and later, MaxNewSize has been effectively set to infinity, and NewRatio can be used instead to set the value of the new generation
    Second Question  :
    Check this thread well explaind by Ventsi Tsachev 
    Re: Question on "Max Heap size" for Was 70
    Regards
    Shaji

Maybe you are looking for