Question about J2SE execution acceleration.

I have heard that there are ways, apart from any code optimisation,
to accelerate the execution of java programs (for example,
when it starts, there is a pause at the beginning).
Using
-The Official Oracle J2SE compiler and runtime environment.
-The MINGW32 GCJ compiler and runtime,
what simple options are there to have a "leap start" and quicker execution?

Where (or rather when) did you hear this from? The GCJ compiler hasn't been viable for years really.
Most of the optimization tricks have gone the way of the Dodo, do you really have an issue where the startup time is too much? What are your runtime memory settings for the program?

Similar Messages

  • Does SCWCD ask question about J2SE

    J2SE are covered by SCJP. does SCWCD exam ask question about J2SE such as collection,assersion...
    Thanks

    of course you do need to have in depth knowledge about JSE as such knowledge will be assumed (after all, you did have to pass SCJP to be able to enlist for SCWCD).
    So the subjects may turn up in questions, but they won't be the things you're tested on.

  • A question about the execution order of java code

    I have a question about the order of the execution of java code.
    class myclass
    String str1 = new String("str1");
    static String str2 = new String("str2");
    static
    String str3 = new String("str3");
    myclass( )
    String str4 = new String("str4");
    static myfuntion()
    String str5 = new String("str5");
    When I new a myclass object, what is the order of execution about str1,str2.str3 ,str4?
    When I run myclass::myfunction( ) instead of new a myclass object what is the execution order about str1, str2, str3, str4, str5?
    Thanks

    hello,
    I think there may be one thing can't use println to make sure.
    class myclass
    static {  System.out.println("str1");   };
    myclass() { System.out.println("str2"); }
    then str1 appear before str2
    class myclass
    static {  String str1 = new String("str1"); };
    myclass() { String str2 = new String("str2"); }
    then
    str1 initilized before str2,
    str1 get the value str1----->after<----- str2.
    Am I right or wrong?

  • Question about J2SE-File-Adapter

    Hallo,
    i would send with the J2SE-File-Adapter a *.CSV to SAP XI.
    The structure in the SAP XI is:
    PlaintMaintenanceMessagetype
    ......Datasource..................string
    ......Data
    ..........item
    ..............EquipmentID.............string
    ..............FunktionalLocation......string
    ..............Data....................string
    ..............Time....................string
    The *.csv File structure is:
    6ATESTDEMOYVES,
    1234,
    Limo,
    20060105,
    122030,
    The configuration of the J2SE-File-Adapter is:
    classname=com.sap.aii.messaging.adapter.ModuleFile2XMB
    version=30
    mode=FILE2XMBWITHROWCONVERSION
    ##File Adapter specific parameters (example, see docu)
    ##file.type=BIN
    file.type=TXT
    file.encoding=UTF-8
    xml.documentName=ns:PlaintMaintenanceMessagetype xmlns:ns="http://doehler.com/sapxi/krausdemosender"
    xml.structureTitle=6ATESTDEMOYVES
    xml.processFieldNames=fromConfiguration
    xml.fieldSeparator=;
    xml.fieldNames=Datasource,EpuipmentID,FunctionalLocation,Data,Time
    But it not runing! Can anybody help me? Are any How to guide to send a *.csv with the J2SE-File-Adapter.
    Thanks laura
    With the XML File it works. But there are ofer 40000 records in the *.csv, and i will not create this in *.xml!
    The structure of the XML.File are:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns:PlaintMaintenanceMessagetype xmlns:ns="http://doehler.com/sapxi/krausdemosender">
      <Datasource>6ATESTDEMOYVES</Datasource>
      <Data>
        <item>
          <EpuipmentID>1234</EpuipmentID>
          <FunctionalLocation>Limo</FunctionalLocation>
          <Data>20060105</Data>
          <Time>122030</Time>
        </item>
        <item>
          <EpuipmentID>1235</EpuipmentID>
          <FunctionalLocation>Bier</FunctionalLocation>
          <Data>20060106</Data>
          <Time>122031</Time>
        </item>
       </Data>
    </ns:PlaintMaintenanceMessagetype>

    Hi Laura,
    You can navigate thru these links to get more information:
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/246b3de666930fe10000000a114084/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e698aa90-0201-0010-7982-b498e02af76b
    Cheers,
    Chandra

  • Another question about query execution speed.

    I know I should normally start with posting the query but my question will take a little different direction, so here is the deal:
    We have an Apex application, there is a query on one of the pages that for certain users takes quite long, lets say 1min to 2 min, depending on how many records the query returns. The actual query varies depedning on some security settings and other parameters on the page - it's constructed by pl/sql function returning sql.
    By querying v$sql I get the exact sql run by the user for who the query takes long time to execute.
    Then I run that same sql statemt in Toad and it always takes 2 seconds to execute. For the user executing the same sql from Apex takes consistently 50-100 sec. My Toad is set to return up to 10,000 records and the query returns less than 500.
    Can somebody help me make some sense of this?
    George

    Hi there
    geo2 wrote:
    We have an Apex application, there is a query on one of the pages that for certain users takes quite long, lets say 1min to 2 min, depending on how many records the query returns. The actual query varies depedning on some security settings and other parameters on the page - it's constructed by pl/sql function returning sql.To render a page, Apex does much some more stuff than just run the query. For instance, depending on the type of pagination you have enabled it needs to get the total number of rows to display "x to y of z" (or to display the message "more than nnn rows found"). Have you enabled debugging in Apex to be sure that most of the waiting time is spent on that query?
    By querying v$sql I get the exact sql run by the user for who the query takes long time to execute.
    Then I run that same sql statemt in Toad and it always takes 2 seconds to execute. For the user executing the same sql from Apex takes consistently 50-100 sec. My Toad is set to return up to 10,000 records and the query returns less than 500.Does Toad takes only 2 seconds to retrieve all rows or just to get the first top rows?
    Luis

  • Question about ODI execution log

    Hi guys,
    I need to delete the result of the execution of a package I'm referring to get in a table if the scenario runs with status of warning, mistake or sucess. I can see the values in the operation.
    Do you know uin which table ODI stores this values?
    Thanks in advance.

    ORV wrote:
    Hi guys,
    I need to delete the result of the execution of a package I'm referring to get in a table if the scenario runs with status of warning, mistake or sucess. I can see the values in the operation.
    Do you know uin which table ODI stores this values?
    Look for SNP_SESSION
    SNP_STEP_LOG
    Thanks in advance.

  • Three Questions about J2SE 5.0

    I'm liking what I see with this new upgrade to Java, but I do have some questions that I hope you guys might be able to answer:
    1) Generics and Arrays
    I'm updating a container class I wrote which used an Object array to store its elements:
    Before:
    public class BinaryHeap implements java.util.Collection {
        Object[] elements;
    After:
    public class BinaryHeap<E> implements java.util.Collection<E> {
       E[] elements;
    }Everything works well until the constructor...
    public BinaryHeap<E>() {
       elements = new E[DEFAULT_SIZE];  // Doesn't compile
    }My question is, how do I create an array of parameterized types?
    2) Metadata
    Yeah, what does it do and how do I use it? This question's open to all input.
    3) Variable arguments
    I understand how to declare a method with them, but not how to access them within the method. Any clarification?
    Thank you very much for your help!

    1) I peeked into the source code for ArrayList, and here is what was done there:
    import java.util.*;
    public class BinaryHeap<E> extends java.util.AbstractCollection<E> {
        private E[] elements;
        private static final int DEFAULT_SIZE =17;
        public BinaryHeap() {
           elements = (E[]) new Object[DEFAULT_SIZE]; //<<--------<<
        //to make class non-abstract
        public int size() {
            return 0;
         //to make class non-abstract
        public Iterator<E> iterator() {
            return null;
        public static void main(String[] args) {
            new BinaryHeap<Integer>();
    }

  • About the execution order

    I have a question about the execution order of the program, which bothers me for a long time.
    If anybody knows how to resolve it, please help me and thanks a lot.
    The code is very simple and as follows in class ExecutionOrder.
    I would like the output is:
    Thread is going to start!
    Thread is running!
    Thread is ended!
    But actually the output is always:
    Thread is going to start!
    Thread is ended!
    Thread is running!
    public class ExecutionOrder extends Thread 
        private static ExecutionOrder mainThread;
        public static void main (String[] args)
            mainThread = new ExecutionOrder ();
            mainThread.test();   
        public void test (){
            testStart();      
            mainThread.start();      
            testEnd ();
        public void testStart (){
          System.out.println ("Thread is going to start!");
        public void testEnd (){
          System.out.println ("Thread is ended!");
        public void run ()
            System.out.println ("Thread is running!"); 
      

    Resources for learning about threads:
    Java's Thread Tutorial
    JavaWorld: Introduction to Java threads
    IBM: Introduction to Java threads
    Google: java+threads+tutorial

  • Basic questions about Exchange Rate Differences

    Hi Experts?
    I have few questions about exchange rates:
    1. Currently in 2007, under what circumstances are exchange rate differences not posted automatically? In the previous version, it was this case when invoices are linked to payment, and manual exchage rate differences had to be run.
    2. What are unrealized exchange rates? and When do unrealized exchange rates occurs?
    3. In account oo logical pinciples, why is there a need to auto reverse Exchange rate differences or Conversion rate differences during the opening of a new posting period??
    Much Thanks!
    Warmest Regards,
    Chinho

    Hi Chinho,
    you may find useful info in this wiki:
    [How does SAP Business One deal with Realised and Unrealised Exchange Rate Differences? |https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=60654139]
    & also these 2 EES:
    [Exchange Rate Differences|https://psd.sap-ag.de/PEC/calendar/html/recording.php?hck=7a4f07ef7ac81ec31e04d55faffe33bdde93ec2398c338760e0d98adab7ba5acf2c39b2da1782f45e8a5a4d337dedcc647afebddd531782af42bafae98ce7ed5]
    [Exchange Rate|https://psd.sap-ag.de/PEC/calendar/html/recording.php?hck=e5397f14c44f8df754617194051dab1ad38f59f08580406c2efd59aa4c0f71616713c2abe76bc503e08f2f5eda4863634f6fe99ad39d46c947c09623b91e53ca]
    As a rule, in version 2007 it's the unrealised exchange rate differences on the BP side that are relevant since with the introduction of the unified internal reconciliation engine realised partial exchange rate differences are automatically posted. You also use the functionality to post exchange rate differences for FC GL accounts at a particular execution day.
    All the best,
    Kerstin

  • Question about inserting Sysdate (SQL)

    Hi all,
    I got a question about records insert when one of the fields is sysdate.
    I have to store several records representing a log, generated by the execution of a database package.
    Inside my package I wrote an internal procedure devoted to insert a record in my log table for each processing step I wanted to trace (I call this proc each time I want to record a certain step of my package).
    My log table structure is: PREC_LOGS(log_date DATE, log_message VARCHAR2(1000)), no constraints at all.
    Database ver. 8.1.7.1.0 - Production for VMS O.S.
    The 'problem' occurs when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS). In this case, if I select log_date,log_message ... order by log_date, the list of records I get respects the sort condition, but when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS), it doesn't respect the order of the steps theoretically inserted by the internal proc.
    Resault
    25-07-2002 11:10:20 ........ (date changed)
    25-07-2002 11:10:22 Loading data for order nr. 82364 (step 3)
    25-07-2002 11:10:22 Verifying order nr. 82364 (step 2)
    25-07-2002 11:10:22 Procedure started for order nr. 82364 (step 1)
    25-07-2002 11:10:22 Updating conditions for order nr. 82364 (step 4)
    25-07-2002 11:10:22 Procedure accomplished for order nr. 82364 (step 6)
    25-07-2002 11:10:22 Commit changes for order nr. 82364 (step 5)
    25-07-2002 11:10:24 ........ (date changed)
    Please ask for more detail if someone is interested in replying...I realize it's not a very clear explanation of my issue.
    Thanks, Marco

    Hi
    Add a field to the table that is that uses a sequence
    PREC_LOGS(log_id NUMBER(30),log_date DATE, log_message VARCHAR2(1000))
    Create a database sequence
    The insert statement now becomes something like
    INSERT INTO PREC_LOCS(log_id, log_date, log_message)
    VALUES (sequence_name.NEXTVAL, SYSDATE, 'Some message');
    Then order by the log_id when you do your select.
    Daniel

  • Few questions about "city explorer"

    - I noticed it can tell me where the metro is, but could nokia maps + city explorer tell me what line should i take in the metro and which station i should go out?
    - Does it all require data transfering while i'm walking, or can i donwload it all before, where i have wifi? (like nokia map-loader)
    - same question about the guides...
    Thank's!

    You can find most of the answers here - or to links to the answers -
    http://help.sap.com/businessobject/product_guides/boexplXI32/en/exp_acc_admin_en.pdf
    I haven't used the Explorer accelerated for a long time, but as far as I remember in rsddstat i think you can identify the explorer usage from the user id, but not sure - try and see.
    You can also run all your BIA indexes at the same time if you want to, the algorithm takes care of the table locks and switch to other index
    Querysnap shot index is a SNAPSHOT of the data at the time of the index - it will never change unless you re-run the query and index it. Regular BWA indexes gets updated when you load data to underlying cubes and run BWA rollups/change runs. The querysnap shot data will not change. I like them if my query output miliions of lines - such as ZCUSTOMER. With query snapshot, you can put all of them to explorer for customer segmentation etc purposes
    Cheers
    Tansu

  • Question about "synchronized" and "wait"

    Hello, everyone!
    I have seen a piece of code like this,
    synchronized (lock)
    //do operation 1
    lock.wait();
    //do operation 2
    I think in the above piece of code, when a thead finished operation 1, it will release the lock and let other threads waiting for the lock have chance to run the same block of code. Am I correct?
    If I am correct, I have a further question, a "synchronized" block means a set of operations that can not be interrupted, but when invoke "wait" method, the thread running in the "synchronized" block will be terminated (interrupted) by release the lock and other threads will have chance to enter the "synchronized" block. In short, the execution inside the "synchronized" block will be interrupted. So, I wonder whether the above piece of code is correct and conforms to the principle of "synchronized". And what is its real use?
    Thanks in advance,
    George

    Thanks, pkwooster buddy!You're welcome
    I just wondered whether "wait inside a synchronized
    block" technology is thread safe. Please look at the
    following example,wait and synchronized are thread safe.
    public class Foo {
    int mVal= 0;
    public final Object mLock = ...;
    public void doIt() {
    synchronized(mLock) {
    mVal = ...;
    mLock.wait();
    if (mVal == ...) {
    // do something
    } else {
    // do something else
    }If we have two threads, T1 and T2, enter the block in
    their respective order, and T1 is woken up first, T2
    may have tampered with T1's execution path because T2
    changed mVal while T1 was asleep. So T2 manipulate
    instance field mVal is a side-effect.when you do the wait() you give up the lock and the other threads get a chance to run. When you exit the wait() you get the new value of the myVal variable which may have been changed. This is exactly what you want. To make that not thread save you could do
    int temp = myVal;
    wait();
    if(temp == ...)in this case the variable temp contains the old vale of myVal.
    >
    I think the most safest way is never wait inside a
    synchronized block, but it is less efficient. What do
    you think about the trick of wait inside a
    synchronized block? I think you are very experienced
    in thread field from your kind reply.
    Thanks in advance,
    Georgewait(), notify() and notifyAll() are very useful. You need them when you want threads to cooperate in an predictable manner. I recommend that you review the section on consumer and producer classes and wait and notify in the Threads Tutorial. It gives good examples. For a practical example of this you could also take a look at my Multithreaded Server Example. It implements a simple chat server that switches String messages. Look especially at the send(), doSend() and popMessage() methods in the StreamConnection class. These allow the receive thread of one user to send messages out using the send thread of another user. If you have questions about that example, please post the questions on that topic.
    Hope this helps.

  • Question about Lego Mindstorms Capabiliti​es

    Hello, thank you for reading my question!
    I am currently working on the creation of a teleoperated robotics lab. for a introductory robotics course. I wish to allow students to control a labyrinth-solver robot via Labview, with the Lego NXT toolbox. A computer server will be connected to the Lego via Bluetooth, and the student communicates with the server via  a web browser VI (a web published VI). I am interested on the Lego Mindstorm platform but I wanted to ask some questions about its software capabilities:
    *Is it posible via a web VI interface for the student to load a program onto the Lego Mindstorm? My idea is to allow the student to load a VI (or the equivalent of a LEGO NXT ".exe")onto the server, and the server to load the program to the Lego. The Web VI already has some parameters the student can change a simple program execution (see [1]), but I also wanted to give the student the chance of loading their own program for more complicated algorithms.
    Thank you in advanced for your time and patience!
    [1] Maze Solving Algorithms
    http://en.wikipedia.org/wiki/Maze_solving_algorith​m

    thats the exact error, could it be something of the automathic update of the driver once the joystick was conected through the usb?

  • Question about Runtime.exec

    Rob,
    Thanks for your help.
    I asked a question about a weird Exception on Nov 14, and you told me that I am
    using Runtime.exec to start an external process, and that process is crashing.
    I am a green-hand on Weblogic, and I am trying to enhancing a project developped
    by another person, so I am not familiar with some concepts yet.
    Could you please give me some simple explanation about Runtime.exec and external
    process?
    I found two methods that uses "Runtime" from two classes as following, could you
    help me to see whether or not there is something wrong with the usage of Runtime?
    Thank you very much.
    private int runShellCommand(String command) {
    int exitVal = -1;
    try {
    File runDir = new File(runDirectory);
    String[] env = new String[0];
    Runtime rt = Runtime.getRuntime();
                   double start = System.currentTimeMillis();
    Process proc = rt.exec(command, env, runDir);
    // Capture output in separate thread
    ThreadedStreamReader error = new ThreadedStreamReader(proc.getErrorStream(),
    "ERROR");
    ThreadedStreamReader output = new ThreadedStreamReader(proc.getInputStream(),
    "OUTPUT");
    error.start();
    output.start();
    exitVal = proc.waitFor();
    if (logger.isDebugEnabled()) {
         double runtime = (System.currentTimeMillis() - start) / 1000.0;
         logger.info("run " + runId + " " + command + " finished in " + runtime
    + " seconds");
    } catch (IOException e) {
    logger.fatal("DOE-2 failed \n" + e.getMessage());
    } catch (InterruptedException e) {
    e.printStackTrace();
    return exitVal;
    public static void main(String[] args) throws Exception, InterruptedException
    final Doe2MessageServer server = new Doe2MessageServer();
    while(!connected) {
    Thread.sleep(1000);
    logger.info("Attempting to start JMS service ...");
                   try {
              server.init();
                   } catch (Exception ex) {
    // shutdown hook to close JMS connection
    Runtime.getRuntime().addShutdownHook(
    new Thread() {
    public void run() {
    server.finalize();
    server.receiveMessage();

    Runtime.exec is a J2SE API. It's not really specific to WLS.
    You can read about it here:
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runtime.html
    It looks like you are starting a JMS Server in a separate process and
    that process is crashing.
    (You could of course just use WLS's JMS Server instead :>)
    -- Rob
    Iris Qu wrote:
    Rob,
    Thanks for your help.
    I asked a question about a weird Exception on Nov 14, and you told me that I am
    using Runtime.exec to start an external process, and that process is crashing.
    I am a green-hand on Weblogic, and I am trying to enhancing a project developped
    by another person, so I am not familiar with some concepts yet.
    Could you please give me some simple explanation about Runtime.exec and external
    process?
    I found two methods that uses "Runtime" from two classes as following, could you
    help me to see whether or not there is something wrong with the usage of Runtime?
    Thank you very much.
    private int runShellCommand(String command) {
    int exitVal = -1;
    try {
    File runDir = new File(runDirectory);
    String[] env = new String[0];
    Runtime rt = Runtime.getRuntime();
                   double start = System.currentTimeMillis();
    Process proc = rt.exec(command, env, runDir);
    // Capture output in separate thread
    ThreadedStreamReader error = new ThreadedStreamReader(proc.getErrorStream(),
    "ERROR");
    ThreadedStreamReader output = new ThreadedStreamReader(proc.getInputStream(),
    "OUTPUT");
    error.start();
    output.start();
    exitVal = proc.waitFor();
    if (logger.isDebugEnabled()) {
         double runtime = (System.currentTimeMillis() - start) / 1000.0;
         logger.info("run " + runId + " " + command + " finished in " + runtime
    + " seconds");
    } catch (IOException e) {
    logger.fatal("DOE-2 failed \n" + e.getMessage());
    } catch (InterruptedException e) {
    e.printStackTrace();
    return exitVal;
    public static void main(String[] args) throws Exception, InterruptedException
    final Doe2MessageServer server = new Doe2MessageServer();
    while(!connected) {
    Thread.sleep(1000);
    logger.info("Attempting to start JMS service ...");
                   try {
              server.init();
                   } catch (Exception ex) {
    // shutdown hook to close JMS connection
    Runtime.getRuntime().addShutdownHook(
    new Thread() {
    public void run() {
    server.finalize();
    server.receiveMessage();

  • Question about Local Variables (Multiple answers welcomed!)

    A couple of questions about Local Variables
    1. Programmers always say: “Do not abuse of Local Variables”. I’d like to know, when and where Local variable are most efficiently used?
    2. If I have to create a couple of local variables, is there anyway to “clone” them without going through the repetitive “create/local variables” mouse click each time? (When I try to copy and paste, it creates a new variables instead of the one that I am trying to reproduce)
    3. Which is faster in execution: Updating a variable through a) writing to property node/value or b) through local variable
    Everyone’s input is welcomed, so if this question is already answered, please
    feel free to add additional comments/answers!

    1. Use Local Variables in user interface code and no where else. The only exception is using a local variable of a cluster output to define the datatype for a bundle by name node.
    2. You can drag copy them then right click to get to a menu of all the currently defined controls and indicators on the VI.
    3. B. The problem with A is that it forces a thread switch to the user interface thread--which can take time if you aren't already in it, and it's a very convoluted process under the hood. NI's advice never update indicator values through a property node unless you absolutely, positively can't figure out some other way of doing it.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Standard DSO - Write Optimized DSO, key violation, same semantic key

    Hello everybody, I'm trying to load a Write-Optimized DSO from another Standard DSO and then is raised the "famous" error: During loading, there was a key violation. You tried to save more than one data record with the same semantic key. The problema

  • Can I prevent automatic failover for a period of time?

    We have two Exchange 2013 servers (and a witness server) in a DAG.  They are all VMWare virtual.  We have recently migrated our 500 users from Ex2007 to Ex2013, so there is a bit of a learning curve for us. One of the servers "A" is has a better hard

  • HP 8500 All in one printer, Error msg to change yellow/black cartridge

    Cartridge was changed but same error msg occurs. SN {Removed for privacy}  DATE:  12-5-08.  What can I check now that there is new ink cartridge properly installed.  We have turned off, left it set and triedturning on again.

  • How do i turn BT off?

    Hi all, as i searched though pages and pages i found no definitive answers.... I want to turn off my BT (and be able to turn it back on) and it is grayed out on the menu bar drop down list. When i go to BT prefs it is ON with nowhere to change that s

  • No refund for the "Free Trial"

    I subscribed for the "free trial" of FormsCentral Basic Service on 10/04/2014 and it was canceled before a month of use. I was charged 14.99 dollars on my credit card and still didn't receive my refund. I was aware that I would be charged when subscr