Why not always use -server option?

Hello!
I've tried running some my applications with -server option - and discovered that for non-GUI apps -server renders drastic increase in execution speed.
For example code below takes only 2 seconds to execute with java -server while it takes more then 120 seconds with java -client option.
Now I'm considering writing all apps with
Runtime.exec("java -server MyApplication");Can someone tell me in what cases -server is a bad choice, and when it's OK?
And, in my code - does java runtime really create 1000 threads - or is there some optimization?
        public void run()
                int q=0;
                for (int i=0; i<10000000; i++)
                        q++;
        public static void main (String args[])
            long l_start = System.currentTimeMillis();
                for (int h=0; h<1000; h++)
                        new Hell().start();
                System.out.println("Operation took "+(System.currentTimeMillis()- l_start)/1000+" seconds");

JVM tutorial states that there are the cases when server performs slower. If you going to execute a small utility (<20 sec), use client.

Similar Messages

  • Why not always use H-REAP

    Hello All,
    I apologize if this has appeared in another thread, but it has been something I've been mulling over now for a couple weeks.  With the improvements in the 7.2.103, is there any reason to not automatically make every deployment an H-REAP (now FlexConnect) deployment?  Just the mere fact of WLAN survivability during controller outage, without a redundant controller of course, is a strong incentive.  With all the progress Cisco has made, I'm trying to come up with reasons to not just configure every deployment to be H-REAP/Flexconnect.  Off the top of my head the only reasons I can think of are:
    -extra config on the access switch
    -limited to 25 AP's per H-REAP group.  (Even this reason is really not that big of one when designed properly)
    I'm highly curious what the community thinks.
    Thanks in advance,
    Matt

    Matt,
    At this time I don't think the question should be why or why not use FlexConnect of every single deployment. Local mode and FlexConnect both have their own benefits and each should be carefully considered for the deployment in question. A few items to keep in mind are:
    Where will the APs be located in relation to the WLC?
    Who is going to be managing this system? (FlexConnect is more difficult to manage than local due to the additional configuration.)
    Does it make sense for data traffic? (In one case I had a customer that did not have their controller located at a central point of their network... Not my choice or reccomendation.)
    Do I need AAA override?
    FlexConnect isn't terrible but it's still got a ways to go regarding development. It was designed around the idea of remote branch deployment, not necessairly large depolyments at one site where a customer could have multiple redundant controllers.
    So far some limitations I've personally faced are bugs.
    Don't let that stop you from utilizing FlexConnect as it does indeed have its uses.
    For some good information check out the follwoing link:
    http://revolutionwifi.blogspot.com/2010/06/h-reap-deployment-guidelines-and.html
    Some of it may be a little out of date as it was written in 2010.
    Regards,
    Aaron

  • Edge 95 MXP always use multisite option instead multiway

    Hello, we have a edge 95 mxp were we have configure multiway but when we want to make a conference call always use multisite option instead of multiway. Our deployment scenario is based on the following scenario: Deployment with TelePresence Conductor connected to Unified CM (page38) from the following deployment guide:http://www.cisco.com/c/dam/en/us/td/docs/telepresence/infrastructure/vcs/config_guide/X8-2/Cisco-TelePresence-Multiway-Deployment-Guide-X8-2-XC2-4.pdf.
    The Egde 95 MXP is register on VCS-C, DX650 and CTS500 are register in CUCM.
    Our versions are
    VCS-C 8.2.1
    CUCM 10.5.1.11901-1
    Conductor XC3.0.2
    vTS: 4.1(1.79)
    Edge95 MXP:F9.0 PAL
    And below is the config of the Edge95
    xconfiguration m
    *c xConfiguration MainVideoSource: 1
    *c xConfiguration Multipoint Mode: Multiway
    *c xConfiguration Multipoint MultiwayURI: "(205)([3-4])(.)@domain(.*)"
    *c xConfiguration Multipoint MultiwayMultiprotocol: On
    *c xConfiguration Multipoint MultiwayStartupPeriod: 4
    *c xConfiguration MaxBandwidth: 6144
    Any help we will be useful
    Regardd
    Anestis

    Hi,
    Hi Wayne, I change the Multiway URI to be as it is the actual alias in my conference alias template on Conductor
    xconfiguration m
    *c xConfiguration MainVideoSource: 1
    *c xConfiguration Multipoint Mode: Multiway
    *c xConfiguration Multipoint MultiwayURI: " [sip:|h323:][email protected]"
    *c xConfiguration Multipoint MultiwayMultiprotocol: On
    *c xConfiguration Multipoint MultiwayStartupPeriod: 4
    *c xConfiguration MaxBandwidth: 6144
    But from the Edge 95 I'm in a point-to-point call and I see the following 
    xstatus call
    *s Call 1 (status=Synced, type=Vtlph, protocol=H323, direction=Outgoing, logTag=21):
         CallRate: 768
         RemoteNumber: "20498"
         Mute: Off
         Microphone: On
         Duration: 318
         MuteOutgoing: Off
         CallOnHold: False
         RemoteSiteOnHold: False
         MultiwayProgress: Off
         Channels 1 (type=Incoming):
           Rate: 768
           Restrict: Off
           IPLR: On
           Encryption (status=Off): /
           Audio (status=Active):
             Protocol: G722
             Rate: 64
           Video 1 (status=Active):
             Protocol: H264
             Resolution: Custom
             Rate: 704
           Video 2 (status=Inactive): /
           Data (status=Inactive): /
         Channels 2 (type=Outgoing):
           Rate: 768
           Restrict: Off
           IPLR: Off
           Encryption (status=Off): /
           Audio (status=Active):
             Protocol: G722
             Rate: 64
           Video 1 (status=Active):
             Protocol: H264
             Resolution: w448p
             Rate: 704
           Video 2 (status=Inactive): /
           Data (status=Inactive): /
    *s/end
    *s Call 2 (status=Disconnected, type=NA, protocol=NA, direction=NA, logTag=NA):
         Cause: 16
    *s/end
    *s Call 3 (status=Disconnected, type=NA, protocol=NA, direction=NA, logTag=NA):
         Cause: 16
    *s/end
    *s Call 4 (status=Disconnected, type=NA, protocol=NA, direction=NA, logTag=NA):
         Cause: 16
    *s/end
    *s Call 5 (status=Disconnected, type=NA, protocol=NA, direction=NA, logTag=NA):
         Cause: 16
    *s/end
    *s Call 6 (status=Disconnected, type=NA, protocol=NA, direction=NA, logTag=NA):
         Cause: 255
    *s/end
    *s Call 7 (status=Disconnected, type=NA, protocol=NA, direction=NA, logTag=NA):
         Cause: 255
    *s/end
    OK
    Do I have to make any more config on Edge95 because it seems to me that can not go to the multiway for a conference.
    Regards
    Anestis

  • HT6114 thanks a bunch Apple..why not give me the option to save the Mavericks installation file instead of automatically deleting it

    I live out in the country and have slow broadband. The download took a few minutes short of 12 hours. I have 3 Macs to upgrade to Mavericks and read that I could copy the installation file to an external drive and use that to upgrade the others.
    Before the first installation, I checked the Downloads folder for the file but couldn't see it. I though ok, I'll run the install and look for it afterwards. Still couldn't find it afterwards so have googled and found that the installation file is deleted automatically after the installation. Bloody brilliant. I now have another 12 hour download to run.

    Clock Kate wrote:
    My main complaint still stands...why not give us the option to save the installation file before it is deleted. Not user friendly.
    If Apple were to bring up a dialog explaining all the consequences of running the installer and asking for your confirmation of each one, that would be frustrating and confusing. Most people have one Mac, they install the OS and it is not needed again. It just takes up space. If you want to create an installer disk, there are instructions for doing so.
    Congratulations. You have learnt how the installer works through your own experience!  All it cost you was your time. Not all experience is so easily gained.

  • HT5622 I did not choose "use icloud" option for my initial setup.  so, it is creating for not enough space in my ipad.  How do I go back and set up icloud to store data?

    I did not choose "use icloud" option for storing during my initial setup.  How can I reset icloud account, so it can be used for storing.

    Welcome to Apple Support Communities
    If you are planning on using iCloud to store files, forget about iCloud and use a cloud storage service like SkyDrive or Dropbox. iCloud is focused on information sync between the iPhone, iPad, iPod touch, Mac and PC instead of storing files like MobileMe. It's not worth using iCloud for this.
    If you still want to set up iCloud, open Settings > iCloud, log in with your Apple ID and follow its steps

  • Media Encoder CS6 does not always "Use Previews"

    I've attempted several transcodes using pre-rendered timelines in Premiere Pro. Media encoder does not always use the preview files despite the appropriate box being checked. Any suggestions what I can look for? I don't see that I am doing anything different between the times it works and the times it doesn't.
    Bruce B.

    We are all just incompetent users here.  As pointed out before this is just a user to user forum, Adobe rarely checks in.
    I was hoping by now you would have gotten to the bottom of this problem and were offering a solution.

  • Why not to use static methods - with example

    Hi Everyone,
    I'd like to continue the below thread about "why not to use static methods"
    Why not to use static methods
    with a concrete example.
    In my small application I need to be able to send keystrokes. (java.awt.Robot class is used for this)
    I created the following class for these "operations" with static methods:
    public class KeyboardInput {
         private static Robot r;
         static {
              try {
                   r = new Robot();
              } catch (AWTException e) {
                   throw new RuntimeException(e + "Robot couldn't be initialized.");
         public static void wait(int millis){
              r.delay(millis);
         public static void copy() {
              r.keyPress(KeyEvent.VK_CONTROL);
              r.keyPress(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_CONTROL);
         public static void altTab() {
              r.keyPress(KeyEvent.VK_ALT);
              r.keyPress(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_ALT);
                   // more methods like  paste(), tab(), shiftTab(), rightArrow()
    }Do you thinks it is a good solution? How could it be improved? I've seen something about Singleton vs. static methods somewhere. Would it be better to use Singleton?
    Thanks for any comments in advance,
    lemonboston

    maheshguruswamy wrote:
    lemonboston wrote:
    maheshguruswamy wrote:
    I think a singleton might be a better approach for you. Just kill the public constructor and provide a getInstance method to provide lazy initialization.Thanks maheshguruswamy for advising on the steps to create a singleton from this class.
    Could you maybe advise also about why do you say that it would be better to use singleton? What's behind it? Thanks!In short, it seems to me that a single instance of your class will be able to coordinate actions across your entire application. So a singleton should be enough.But that doesn't answer why he should prefer a singleton instead over a bunch of static methods. Functionally the two are almost identical. In both cases there's only one "thing" on which to call methods--either a single instance of the class, or the class itself.
    To answer the question, the main reason to use a Singleton over a classful of static methods is the same reason the drives a lot of non-static vs. static decisions: Polymorphism.
    If you use a Singleton (and and interface), you can do something like this:
    KeyboardInput kbi = get_some_instance_of_some_class_that_implements_KeyboardInput_somehow_maybe_from_a_factory();And then whatever is calling KBI's public methods only has to know that it has an implementor of that interface, without caring which concrete class it is, and you can substitute whatever implementation is appropriate in a given context. If you don't need to do that, then the static method approach is probably sufficient.
    There are other reasons that may suggest a Singleton--serialization, persistence, use as a JavaBean pop to mind--but they're less common and less compelling in my experience.
    And finally, if this thing maintains any state between method calls, although you can handle that with static member variables, it's more in keeping with the OO paradigm to make them non-static fields of an instance of that class.

  • Can not connect using Server Admin - server running.

    Hi there, can anyone help me?
    I am running OSX Server Tiger on a Mac Pro G5. It has worked perfectly for several years.
    Suddenly I cannot connect to the server using Server Admin either locally or remotely - the machine continues to function perfectly. The only problem is that I can not make any changes and I am nervous! I would prefer not to reformat and reinstall.
    I did have some network problems a while ago which meant that I changed some IP numbers manually, and I installed and de-installed an ADSL modem.
    I am hoping that deleting a library here or there will solve the problem. Any ideas?
    Thanks, Drew

    Last time this happened to me I deleted the server from Server Admin and re-added it

  • Computer will not sleep using Power Option

      T he  Power Option on my HP Pavilion p6706f P C  turns off display but not computer using a predetermined time schedule. Have Windows 7 home Premium system.
    This question was solved.
    View Solution.

    Hopefully I can answer this for both of you. Here is a lengthy tutorial on Sleep mode settings and problems.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • Why not ios provides edit option before calling in keypad ??

    Why not apple ios provides edit option before call through the keypad ?? Its a pain to save the number in order to edit it before calling

    Suggest such to Apple:
    http://www.apple.com/feedback/iphone.html

  • NEED TO UNDERSTAND WHY/WHY NOT TO USE/BUY SERVER

    Hey there -
    I have a small business (3 employees total.)
    My issue thus far has beens scheduling meetings through iCal, etc., and sharing files. Basically, I want my assistant and my partner (and my wife at times as well) to be able to send me invites (vice/versa) for meetings AND also have the ability to make changes to those meetings. Meaning, if my assistant sends me an invite, then only SHE can make changes to that meeting. But say I want to move the time myself or add something to the event, then I need to have her do it and resend the updated invite.
    Will server fix this?

    Hi mcforman-
    No, OSX Server in and of itself will not solve your problem. Your money may be better spent on a scheduling program that can suit your needs.
    Have you tried posting your question in the iCal forum? There are knowledgeable folks there that may be able to help: Category : iCal
    Luck-
    -DaddyPaycheck

  • Why not to use static methods in interfaces?

    why?

    Because static methods are always attached to a particular class -- not an object. So object polymorphism (which is what interfaces are good for) won't help. Now, what you can do is say that subclasses must implement a method that looks an awful lot like a static method, in that it doesn't depend on object state.
    This bugged me, and it still bugs me a little bit in that I have to instantiate an object of a type in order to call these pseudo-static methods. When the pseudo-static methods tell the user how to initialize the object, you get a bit of a chicken-and-egg problem.

  • Why not just use UDP?

    I have UDP code written in Java that listens to an IP address and port number containing data being sent to that IP and port number. Why wouldn't I just continue to use the traditional UDP paradigm instead of JMS? My ReceiveSocket class creates a new java.net.MulticastSocket instance, creates a new DatagramPacket for reading the bytes, and then takes the datagram packet as input:
    private MulticastSocket m_socket = new MulticastSocket( m_receivePort );
    private DatagramPacket m_packet = new DatagramPacket( buf, buf.length );
    m_socket.receive( m_packet );
    I'm able to receive the data being sent and process it. Can someone explain the benefits of the JMS approach?
    Thanks!

    I would add to Steve's points that the difference in technical specification between UDP and TCP is that TCP guarantees delivery, in order, for messages that are too large to fit in one packet. UDP does not guarantee delivery, or the order of the packets, but it is much faster than TCP.
    It is easy to imagine an application that may want guarantees for some data, and does not care for other data. To address this situation, some implementations of JMS go beyond the specification and provide features to allow non-guaranteed data transfer. For instance, I have been using Sun Java System Message Queue which allows NO_ACKNOWLEDGE which increases performance at the cost of reliability.

  • Organizing mp3 by albums-author not always useful

    I use the MP3 features of my 9630 Tour (Verizon) mostly to listen to sermons/messages.  In my first smartphone (the Motorola Q) I could organize these files in folders and access what I'm looking for that way.  I found with my first BB (the Worldphone), and now the Tour, that this does not help, as it organizes the contents as if they were songs and I am able to locate certain "groups" of messages as "albums" and I can also look by author, and genre.  However, I recently purchased an audio book of the New Testament, NKJV Bible, and discovered that when I select that "album" it displays all the books of the N.T. in order by chapter.  So, I see all the chapter 1's, then all the Chapter 2's, etc., which makes it useless if, and I do, want to listen by book...not just a chapter at a time and then have to search for the next chapter.
    Is there anyway I can get around this?  I don't use the desktop software and connect directly to my pc with my USB cable and simply click and drag my files to my card.
    Thanks in advance!

    It is possible the tracks have lost their identificaiton tags are are not ending up where you expect them to be.  Make a brand new playlist and add them to that.

  • Why not to use Commit

    Hi,
    Can Any one tell the reason why using Commit after Insert will reduce the performace of a proc.
    Thanks

    Are you talking about commit in a loop ? Then see the below links.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4951966319022
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7661190956484

Maybe you are looking for

  • ITunes won't uninstall or open

    When I click on iTunes, this error message pops up "iTunes cannot run because some of it's required files are missing. Please reinstall iTunes." When I try to install it, it will go through the whole process but it still does not open. When I try to

  • Mail screen too big to see dashboard or toolbar

    Somehow when on my email, the screen got so big that I can't access the dashboard or even the toolbar so I can't even start a new message, can't see the icon. The only way I can quit is not by pressing the red button (because I can't access it) but b

  • HDR-AS200V Enter button broken

    I just bought an HDR-AS200V in March. I use the camera a lot for my business. Love the camera but the enter button on the back of the camera has stopped responding to being pressed. No support is available, that I can find, through Sony. Could someon

  • Can't see my score result online

    Hi  I passed the 70-640 exam in November in a Prometric exam center and I have the printed result and the candidate number. but I want to see my exam results and the certificate on the Microsoft website. how can I see that?

  • Lines in smartforms

    Hi,      how can we draw a line or multiple lines  inside a  secondary window in smartforms. regards Hemant