1. On multicore hardware, can multiple threads of the same process in Java run on different CPUs?
It should be possible to run a simulation program on Eclipse, a dead loop thread can occupy the system (4 cores, Win7) andthe cpu,4 of such a thread just occupies 100%. This can be explained from the side that threads can be assigned to different cores. Of course, a specific system should be considered.
2, each Android app for a virtual machine, corresponding to a process, so that there is not a lot of virtual machine copy, wasting a lot of memory space?
No.
The reason is: 1, each app is running on the process created by zygote
2, the virtual machine is also created in zygote
3, so each app can share the memory space of the parent process zygote
4, and this share uses cow (copy-on-write), that is, read-only files can be shared between the parent-child process, will not be modified, the modified part of the changes when the copy.
5, so, not only can not waste space, but also save time
Some questions about Java threads, processes