Skip to main content

Java SE: Support for multiple cores

2 replies [Last post]
preetam_pict
Offline
Joined: 2004-03-04
Points: 0

Hello All
I am planning to write an application which would run on 16 core 64 bit 4 GB Linux machine.
1. I want to know whether Java SE JVM supports multiple cores?
2. If yes then is there any limitation on number of cores?
3. Where can I find the supported cores / hardware documentation?

I am using Java SE 6.0

Thanks & Best Regards
~Preetam

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
peter__lawrey
Offline
Joined: 2005-11-01
Points: 0

> Hello All
> I am planning to write an application which would run on 16 core 64 bit 4 GB Linux machine.
> 1. I want to know whether Java SE JVM supports multiple cores?
Azul claims good scalability up to 768 cores.

> 2. If yes then is there any limitation on number of cores?
The real limit is likely to be based on your hardware architecture. java can handle the threads but that doesn't mean your hardware will handle them efficiently. Given the number of cores, my guess is you have 4 CPUs and in many designs each CPU has its own memory meaning that if a thread on one CPU accesses memory on another CPU this performs badly.

You may find your application can use all cores efficiently, or you may find it can only use one CPU efficiently, but that will be down to your hardware.

Note: you would have much the same problem in any language.

> 3. Where can I find the supported cores / hardware documentation?
I don't think you will find anything so specific. Java creates threads as you instruct it to, it assumes the OS/hardware will do this and its up to you to decide if its performing efficiently

ethere0683
Offline
Joined: 2003-06-18
Points: 0

Yes, java does support multiple cores. However your application will need to be multithreaded in order to take advantage of multiple cores (one thread can run on one cpu at a time). A single threaded program will only take advantage of a single core (discounting garbage collection). I don't know of any limit to the number of cores that Java will utilize, that is usually limited by the Operating System you are using.