SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-24-2010, 10:15 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Deciphering a JavaDoc

I'm trying to use this class and need some guidance on the JavaDoc:

http://jezhumble.github.com/javasysm...moryStats.html

I don't understand what to pass into the constructor. The whole purpose of the method is to get the FreeBytes and TotalBytes, what values do I assign to "free" and "total"? I've tried using the class and it seems whatever I use in the constructor gets passed back by getFreeBytes and getTotalBytes.

My code looks something like this;

Code:
public static long xxx () {

  long free = 0;
  long total = 0;

  MemoryStats memory = new MemoryStats(free, total);

  return memory.getFreeBytes();

}
Everything compiles without error and I check for errors at runtime (null memory) but whatever I set "free" to is returned by the method.

I'm obviously missing something fundamental.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #2  
Old 05-24-2010, 10:42 AM
david1234 david1234 is offline
Sage Aficionado
 
Join Date: Nov 2007
Location: Beaverton, OR
Posts: 313
That's a javadoc... not too terribly useful though!

If I had to guess... it's asking you to figure out the free and total, and it's just a "formatter" with it's toString method.
Reply With Quote
  #3  
Old 05-24-2010, 10:50 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by david1234 View Post
That's a javadoc... not too terribly useful though!

If I had to guess... it's asking you to figure out the free and total, and it's just a "formatter" with it's toString method.
Agreed. Very poor docs, and the class itself doesn't look like it does anything useful beyond storing and returning the values you pass in to the constructor.
__________________
-- Greg
Reply With Quote
  #4  
Old 05-24-2010, 11:02 AM
voidpt's Avatar
voidpt voidpt is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Norway
Posts: 296
My Java dialect is a little poor these days , but from some sample code, and some other references in the JavaDoc. I think you need to go about like this:

Code:
JavaSysMon monitor = new JavaSysMon();
MemoryStats memory = monitor.physical();

int iFreeMem = memory.getFreeBytes();
int iTotalMem = memory.getTotalBytes();
Could be wrong. But seems to match with the JavaDoc for JavaSysMon class. That again has the physical method. The physical method probably does the real job and uses MemoryStats as a container to return values.
__________________
SageTV 7.1.9 (headless/service) JavaRE 1.6.0_37 2x FloppyDTV C/CI (DVB-C) (fw: 1.2.10 B43110) (CAM: Conax) Win7 x64 Intel E3-1245V2 3.4GHz 16GB PC3-10600 ECC ASUS P8C WS (Intel C216) APC Back-UPS RS 800 STP-HD300 Extender (fw: beta 20110506 0) - HDMI/SPDIF - Yamaha RX-V2700 - HDMI - Sony KDL-52X2000
Reply With Quote
  #5  
Old 05-24-2010, 11:54 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Thanks gents,

I actually have the code in there that creates a new JavaSysMon() but I didn't pick up the point about the physical() method. I'll look into this more when I get home.

It's definately more than a formatter because I can get some of the other classes and methods to do their thing.

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #6  
Old 05-24-2010, 04:46 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
voidpt gets the cigar! I had to invoke .physical() to get the physical memory object and then use .getFreeBytes().
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download API Javadoc phocker SageTV Studio 30 10-17-2008 07:45 PM
Man have things changed. Need help deciphering everything now. Big Jeff General Discussion 0 02-19-2007 11:27 AM


All times are GMT -6. The time now is 06:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.