Results 1 to 6 of 6
  1. #1
    neeti is offline Member
    Join Date
    Jul 2009
    Posts
    13
    Rep Power
    0

    Default Jvm utilizes multicore

    hi all,

    I am new to this forum and i need your help.

    Question: I want my jvm to utilize all my cores as i have a quad core system.
    I came across that jvm runs on single kernal thread thus other threads remains un utilized and
    I also come across that if we fully utilize jvm efficiently then there is 1 to 1 mapping between jvm
    threads and system threads but these both statements can not be true simultaneously so please help me.
    So, please help me so that i can get out of this confusion and can run my application.

    Thanks
    neeti.

  2. #2
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    6

    Default

    The main thing you need to do to really "utilise" the multiple cores is write your application to use multiple threads where those threads can (a) run simultaneously and (b) use CPU. The JVM generally can't magically do this for you-- YOU need to architecture your application to use threads appropriately.

    The JVM *can* to a very limited extend use multiple CPUs automataically for garbage collection, but this is really minimal-- if your app spends 5% of its CPU time on garbage collection, then with a million squillion cores, the best speedup you'll get is 5%...

  3. #3
    neeti is offline Member
    Join Date
    Jul 2009
    Posts
    13
    Rep Power
    0

    Default

    Thanks 4 ur reply

  4. #4
    neeti is offline Member
    Join Date
    Jul 2009
    Posts
    13
    Rep Power
    0

    Default

    I have another question that jvm utilizes 1 kernal thread for execution
    I want that jvm uses 3 or 4 kernal threads for its execution.
    Is it possible for me to do it.

  5. #5
    literallyjer is offline Member
    Join Date
    Oct 2009
    Posts
    25
    Rep Power
    0

    Default

    Quote Originally Posted by neeti View Post
    I have another question that jvm utilizes 1 kernal thread for execution
    I want that jvm uses 3 or 4 kernal threads for its execution.
    Is it possible for me to do it.
    Why? The JVM runs as it has been coded. If you want to utilize the other cores of your processor for your programs, then you need to do that yourself.

  6. #6
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    6

    Default

    I would verify your statement about "JVM utilizes 1 kernel thread for execution". I'm fairly sure that in recent versions of Hotspot, the JVM uses multithreaded garbage collection by default. But how beneficial this really is depends on what proportion of time is spent on garbage collection. As I say, the main thing you need to do is architecture *your* code to multithread.

Similar Threads

  1. Virtual Machine and multicore system
    By haroonob in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 10-20-2008, 10:31 AM

Posting Permissions

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