• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to check system info cpu usage in linux  RSS feed

 
prateep intha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to check system infosuch as cpu usage, memory usage in linux use javacode please help me
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

There's no built-in Java API to get this kind of information. On Linux, you can get it by opening and reading files in the /proc filesystem, or by using native methods to make the appropriate system calls.

I'm sure there's a 3rd-party Java library that will do this for you -- anybody have any specific recommendations?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Linux provides this information and much more through the proc filesystem. It is a bunch of virtual files which you can read and write as if they were regular text files.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!