Results 1 to 5 of 5
  1. #1
    mr_anderson is offline Member
    Join Date
    May 2010
    Location
    Florida
    Posts
    68
    Rep Power
    0

    Default the Best H.W and O.S for Java

    Hi
    I am developing network program in java and it has hundreds of GUI components and too many threads, I am testing the program on my personal PC with windows Vista and Netbeans 6.8 (CPU 2.2 dualcore, and ram 2 giga), I have reached the limits of the PC i.e. it started to slow down when I compile the program; apparently I need more advanced computer and more reliable O.S, any suggestions for both H.W and operating systems solutions?

    Regards.
    Anderson.

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    my $0.02

    - compilers and IDE are very disk intensive. So having a faster hard drive is better. (faster spindle speeds and faster interconnect, e.g. SATA 6.0Gb/s). Having a good 7200 RPM drive, to going to going all out with hardware raid 0 with many 10K RPM drives.

    - RAM is very important, I have (only) 4GB on my notebook and it is never enough to run eclipse, i'm always using most of it up. So if you want lots-o-ram, this probably means desktop (not notebook). So a motherboard that supports many memory slots. And generally the faster the memory (like DDR3 or what ever it is now and the clock speed of the RAM ) the better.

    - multiple core cpus are only good if you are running threaded applications where the therads can run independently without blocking on other threads. e.g. independent operations such as would happen in a web application server, servicing different requests for different users. If you do have a lot of threads that can work like this, then I have found that the number of cores in the system becomes more important than the clock speed of the CPU, and you can take advantage of slightly slower (e.g. older and now cheaper) CPUs with many cores, and get a dual socket or more board each with multiple cores. But if only a few desktop threads running, then go for the faster speed and fewer cores. Its funny because the 'smallest' cpu you can buy these days always seems to have at least two cores in it now anyway.

    - OS: anything not windows. :) Though i'm biased, and have used linux based OS for a decade now and still believe Java just performs 'better', at least when it comes to coexistence and sustainable responsiveness with other applications that have to run on the system.

  3. #3
    mr_anderson is offline Member
    Join Date
    May 2010
    Location
    Florida
    Posts
    68
    Rep Power
    0

    Default

    Thank you so much, regarding the OS which version of linux do you recommend ?
    I searched the web and I found that Fedora 10 is widely used with java what do you say about it?
    I should also mention that my application is working as a Network monitoring System ( it has reached 25000 lines of programming in netbeans, JAR size of 2 MB) with 14 main threads 10 of them are devoted to ten network connections, each Thread checks the data received from a connection, decodes it and extract the connection parameters, status and updates the GUI , the problem is that when I run the program the CPU usage jumps to 100% (the PC become slower) although the used RAM by the application is 25 MB so I am a little confused about what should I do to correct it.
    My system is HP-DV9000 (with windows vista 32 bit- 2 GHz AMD Turion, 2 GB of RAM).
    Regards.

  4. #4
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    I would say Fedora Core, or Ubuntu are both well supported with community of users .

    But yea, I have observed most any simple Java application on windows with even one thread usually pins the CPU utilization when it is doing any kind of work.

    I am now curious, perhaps there is an issue in how you are doing the threading. I can't imagine how running an application with only 14 threads where most of them are for network handling. Unless its a lot of activity.



    For example if your thread(s) have 'tight while loops', this will certainly burn cpu power.

    Java Code:
     public void run() {
       while (true) {
          if (!someCondition()) {
             continue;
          }
          doSomethingOnCondition();
       } 
     }
    where here the test for someCondition operation causes the while loop to run continously in a tight loop from the continue to the start of the while loop, evaluate this someCondition again, and then repeat,

    Instead if you can introduce some small amount of waiting, this will greatly reduce the cpu load of this type of operation:
    Java Code:
     public void run() {
       while (true) {
          if (!someCondition()) {
             try {
               Thread.sleep(20);
             } catch (InterruptedException ex) { /* empty */ }
             continue;
          }
          doSomethingOnCondition();
       } 
     }
    and for situations where two or more threads must interact, such as one is waiting for a condition or a notification from the other thread, make use of the wait() and notify() or notifyAll() threading API .

  5. #5
    mr_anderson is offline Member
    Join Date
    May 2010
    Location
    Florida
    Posts
    68
    Rep Power
    0

    Default

    Well thank you again, The problem is that I must stick to the tight while loop because the network must be monitored in real time; I think I will switch to the multi-core processor like the quad or even the octal.
    Regards.
    Anderson.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •