File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes JVM - Reducing number of CPUs.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JVM - Reducing number of CPUs.." Watch "JVM - Reducing number of CPUs.." New topic
Author

JVM - Reducing number of CPUs..

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
Hello,
I was wondering if there is a way to reduce the number of CPUs on my Windows machine programmatically in Java or atleast as a command line parameter to the JVM. I would like my tests to run with just 1 CPU on the Windows(XP Prof) machine, just to check performance.

I googled on the net and found that it can be done by making a change to the registry, but I am not comfortable doing that.


- Vishwa
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
In Windows Task Manager, you can do Set Affinity on a process, to adjust which CPU(s) it runs on.

Does that help?


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
thanks Pete,
that worked! I was using eclipse, so I set the Affinity(Number of CPUs) to the eclipse process and it launched my JVM with just one 1 cpu.
I checked up with the foll. call:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JVM - Reducing number of CPUs..
 
Similar Threads
multithreading in single cpu
Multiple CPU
64 bit and 32 bit ?
Websphere and dual cpus
Threads running on single-core or multi-core?