Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (763)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (852)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  getting cpu speed and physical ram  (Read 3266 times)
0 Members and 1 Guest are viewing this topic.
Offline emzic

Senior Devvie





« Posted 2007-10-10 12:26:11 »

hello,
is there a way to get the exact cpu-speed and the amount of physical ram of a client-machine?

all i found was
Runtime.getRuntime().availableProcessors()
which is just the number of cpus/cores.

and
Runtime.getRuntime().maxMemory()
which is just the max-heap.

if it is not possible with java alone, are there native libraries that provide this information?

thanks!
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #1 - Posted 2007-10-10 12:54:42 »

If you aren't writing some kind of system monitor software, that kind of information isn't really interesting.

Max heap is all you got and cpu speed... well, there is speed step, different architectures with very different performance at the same clock speed, and there are also asynchronous architectures (w/o any clock speed whatsoever).

弾幕 ☆ @mahonnaiseblog
Offline emzic

Senior Devvie





« Reply #2 - Posted 2007-10-10 13:13:10 »

well, the reason i would need the exact information, is to make a survey about the computers our clients have.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline broumbroum

Junior Devvie





« Reply #3 - Posted 2007-10-10 16:27:19 »

There's the System.getProperties().list(System.out) that will retrieve ALL properties available to Java. Cheesy

::::... :..... :::::: ;;;:::™ b23:production 2006 GNU/GPL @ http://b23prodtm.webhop.info
on sf.net: /projects/sf3jswing
Java (1.6u10 plz) Web Start pool
dev' VODcast[/ur
Offline Mr_Light

Senior Devvie


Medals: 1


shiny.


« Reply #4 - Posted 2007-10-10 16:43:03 »

1  
2  
3  
4  
5  
6  
7  
public class PrintEnv {
  public static void main(String[] args) {
    for(String key : System.getenv().keySet()) {
      System.out.println(key + " - " + System.getenv().get(key));
    }
  }
}


is slightly more interesting.

PROCESSOR_REVISION
PROCESSOR_IDENTIFIER

but that might only be on windows, anyways I agree with oNyx. even if you know the Ghz they might have slow memory in there. I'd opt with 'auto calibration of video quality settings' and steal the data off that.

ps. mind you it's bad stealing info and not telling so  Kiss

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Offline emzic

Senior Devvie





« Reply #5 - Posted 2007-10-10 17:34:30 »

thanks a lot guys!

ps. mind you it's bad stealing info and not telling so  Kiss

who said, i'm not telling them?
Offline princec

« JGO Spiffy Duke »


Medals: 1041
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #6 - Posted 2007-10-10 18:48:58 »

ps. mind you it's bad stealing info and not telling so  Kiss
How many people know what IE sends to my server with every click on my site?

Cas Smiley

Offline keldon85

Senior Devvie


Medals: 1



« Reply #7 - Posted 2007-10-10 21:14:20 »

ps. mind you it's bad stealing info and not telling so  Kiss

That's only when it's sensitive data, your processor speed is hardly sensitive!!!

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #8 - Posted 2007-10-11 08:19:57 »

Those system properties are not standard properties, so I wouldn't rely on them. They might not work on anything except Windows + Some Specific Sun JRE.

Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (525 views)
2018-06-10 19:43:48

EgonOlsen (629 views)
2018-06-10 19:43:44

EgonOlsen (426 views)
2018-06-10 19:43:20

DesertCoockie (772 views)
2018-05-13 18:23:11

nelsongames (1019 views)
2018-04-24 18:15:36

nelsongames (1001 views)
2018-04-24 18:14:32

ivj94 (1587 views)
2018-03-24 14:47:39

ivj94 (559 views)
2018-03-24 14:46:31

ivj94 (1369 views)
2018-03-24 14:43:53

Solater (564 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!