Bug 118735 - Java 1.5: JMX OperatingSystem mbean yields wrong results
Summary: Java 1.5: JMX OperatingSystem mbean yields wrong results
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: java (show other bugs)
Version: 6.3-PRERELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-15 23:00 UTC by Kees Jan Koster
Modified: 2008-02-29 06:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kees Jan Koster 2007-12-15 23:00:06 UTC
The OperatingSystem mbean returns no useful results for the attributes that I tested, which were: TotalSwapSpaceSize, FreeSwapSpaceSize, OpenFileDescriptorCount, FreePhysicalMemorySize, CommittedVirtualMemorySize, MaxFileDescriptorCount, TotalPhysicalMemorySize.

These values are either seemingly random, or fixed at some unless value.

How-To-Repeat: Start a Java program using FreeBSD's 1.5 Java port. On the command line, enable JMX using the options: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false". Then use jconsole to attach to this process and view the mbean identified by java.lang:type=OperatingSystem.
Comment 1 Greg Lewis freebsd_committer freebsd_triage 2007-12-16 16:04:18 UTC
Responsible Changed
From-To: freebsd-java->glewis

I'll take a look at this one.
Comment 2 Greg Lewis freebsd_committer freebsd_triage 2007-12-16 19:46:53 UTC
State Changed
From-To: analyzed->open
Comment 3 Greg Lewis 2007-12-16 20:50:22 UTC
On Sat, Dec 15, 2007 at 10:52:07PM +0000, Kees Jan Koster wrote:
> The OperatingSystem mbean returns no useful results for the attributes that I tested, which were: TotalSwapSpaceSize, FreeSwapSpaceSize, OpenFileDescriptorCount, FreePhysicalMemorySize, CommittedVirtualMemorySize, MaxFileDescriptorCount, TotalPhysicalMemorySize.
> 
> These values are either seemingly random, or fixed at some unless value.

Take a look at 

j2se/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c

and you'll see this isn't totally unexpected.  Some of these should be
available though.

-- 
Greg Lewis                          Email   : glewis@eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis@FreeBSD.org
Comment 4 dfilter service freebsd_committer freebsd_triage 2008-01-01 16:49:16 UTC
glewis      2008-01-01 16:49:11 UTC

  FreeBSD ports repository

  Modified files:
    java/jdk15           Makefile 
  Added files:
    java/jdk15/files     
                         patch-j2se::management::UnixOperatingSystem_md.c 
  Log:
  . Implement or fix more of the OS specific statistics gathering functions.
    This allows jconsole to show valid statistics for the following
    OperatingSystem MBean statistics (some of these statistics are also shown
    in the Summary and VM tab of jconsole):
  
    TotalSwapSpaceSize, FreeSwapSpaceSize, FreePhysicalMemorySize and
    TotalPhysicalMemorySize.
  
    Note that MaxFileDescriptorCount has always been correct as far as I
    can tell.
  . Also, implement the function for ProcessCpuTime using a non-deprecated
    function (getrusage(2) rather than times(3)).
  
    These changes are restricted to 6.x and higher and have only been tested
    on 6.x (where they appear to work correctly).  The changes are not valid
    for 4.x.  Their validity on 5.x and 7.x is unknown (testing welcome).
  
    The PR is not fully addressed by these changes since
    CommittedVirtualMemorySize and OpenFileDescriptorCount remain bogus.
    Suggestions on how to get these without using kvm(3) would be appreciated.
  
  PR:             118735
  
  Revision  Changes    Path
  1.141     +1 -1      ports/java/jdk15/Makefile
  1.3       +121 -0    ports/java/jdk15/files/patch-j2se::management::UnixOperatingSystem_md.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Greg Lewis 2008-01-01 16:51:48 UTC
On Sat, Dec 15, 2007 at 10:52:07PM +0000, Kees Jan Koster wrote:
> The OperatingSystem mbean returns no useful results for the
> attributes that I tested, which were: TotalSwapSpaceSize,
> FreeSwapSpaceSize, OpenFileDescriptorCount, FreePhysicalMemorySize,
> CommittedVirtualMemorySize, MaxFileDescriptorCount,
> TotalPhysicalMemorySize.
> 
> These values are either seemingly random, or fixed at some unless value.

I've committed a fix that implements TotalSwapSpaceSize, FreeSwapSpaceSize,
FreePhysicalMemorySize and fixes TotalPhysicalMemorySize.
MaxFileDescriptorCount has always been right as far as I can tell.

Not quite sure how to get OpenFileDescriptorCount without using kvm(3)
yet.  Not sure what they mean by CommittedVirtualMemorySize yet.

-- 
Greg Lewis                          Email   : glewis@eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis@FreeBSD.org
Comment 6 dfilter service freebsd_committer freebsd_triage 2008-01-12 23:25:02 UTC
glewis      2008-01-12 23:24:57 UTC

  FreeBSD ports repository

  Modified files:
    java/jdk15/files     
                         patch-j2se::management::UnixOperatingSystem_md.c 
  Log:
  . Implement OpenFileDescriptorCount for BSD.  This requires fdescfs.
  
  PR:             118735
  
  Revision  Changes    Path
  1.4       +55 -3     ports/java/jdk15/files/patch-j2se::management::UnixOperatingSystem_md.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2008-02-29 02:09:04 UTC
State Changed
From-To: open->feedback

glewis: there appear to be commits in the Audit-Trail.  Can this one 
be closed now?
Comment 8 Greg Lewis freebsd_committer freebsd_triage 2008-02-29 06:11:16 UTC
State Changed
From-To: feedback->closed

Oops, forgot to close this after the last two 1.5 and 1.6 patchset updates 
which should cover this.