Showing posts with label jrmc. Show all posts
Showing posts with label jrmc. Show all posts

Saturday, June 12, 2010

JRockit R28 Flight Recorder (ex JRA)

Official documentation here:


http://download.oracle.com/docs/cd/E15289_01/doc.40/e15070/usingjfr.htm
entire PDF:
http://download.oracle.com/docs/cd/E15289_01/doc.40/e15070.pdf

interesting reading
http://blogs.oracle.com/jrockit/2010/04/jrockit_r28_ropsten_released.html


C:\bea11\user_projects\domains\osbdomain>jrcmd
576 jrockit.tools.jrcmd.JrCmd

3356 org.apache.derby.drda.NetworkServerControl start

1908 weblogic.Server



C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 help
1908:
The following commands are available:
kill_management_server
start_management_server
print_object_summary
memleakserver
print_class_summary
print_codeblocks
dump_codelayout
dump_codelist
dump_codemap
print_codegenlist
print_vm_state
print_utf8pool
check_flightrecording
dump_flightrecording
stop_flightrecording
start_flightrecording
print_properties
hprofdump
print_threads
datadump_request
runsystemgc
runfinalization
heap_diagnostics
oom_diagnostics
print_exceptions
version
timestamp
command_line
sanity
verbosity
set_filename
help
print_memusage
set_vmflag
list_vmflags
For more information about a specific command use 'help '.
Parameters to commands are optional unless otherwise stated.







C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 start_management_server
1908:


C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 help start_flightrecording
1908:
Starts a JFR recording
name - Name of recording (string)
settings - Settings file or preset (string)
defaultrecording - Starts default recording (bool, false)
delay - Delay recording start (time, 0s)
duration - Duration of recording (time, 0s)
filename - Resulting recording filename (string)
compress - GZip-compress the resulting recording file (bool,
false)
maxage - Maximum age of buffer data (time, 0s)
maxsize - Maximum size of buffers in bytes (long, 0)




C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 start_flightrecording duration=2m name=myfirstgeoosbrecording
1908:
Started recording 2



C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 start_flightrecording duration=2m name=myfirstgeoosbrecording2
1908:
Started recording 3


C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 check_flightrecording
1908:
Recording : id=1 name="WLDFDiagnosticImageRecording_osbdomain_AdminServer_" duration=0s dest="C:\bea11\user_projects\domains\osbdomain\servers\AdminSe
rver\logs\diagnostic_images\__tmp847859670567686703.jfr" compress=false (running)
Recording : id=2 name="myfirstgeoosbrecording" duration=120s (stopped)
Recording : id=3 name="myfirstgeoosbrecording2" duration=120s (stopped)


C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 help dump_flightrecording
1908:
Copies contents of a JFR recording to file
name - Recording name (string)
recording - Recording id (long, -1)
copy_to_file - Copy recording data to file (string)
compress_copy - GZip-compress "copy_to_file" destination (bool, false)



C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 dump_flightrecording name=myfirstgeoosbrecording recording=2 copy_to_file=myfirstgeoosbrecordingf
ile.jfr compress_copy=true
1908:


C:\bea11\user_projects\domains\osbdomain>dir

Directory of C:\bea11\user_projects\domains\osbdomain
......
12-06-2010 16:53 206.158 myfirstgeoosbrecordingfile.jfr

......


Now you can open the file with JRockit Mission Control


To dump on OutOfMemoryException:
-XX:+FlightRecordingDumpOnUnhandledException

To specify a settings file (more than 1 is possible):
-XX:FlightRecorderOptions=settings=s1.jfs,settings=s2.jfs



To start recording:
jrcmd start_flightrecording settings=filename.jfs

In JROCKIT_HOME\jre\lib\jfr\default.jfs you find an example of settings.

Non-Persistent (profiling data are kept im memory only) is the default storage mode. Typically max 1 minute of history.


REMEMBER TO ENABLE THE "DIAGNOSTIC VOLUME" setting (to Low, Medium or High, but not Off) on your WebLogic server configuration, otherwise Hot Methods will not work!




Thursday, November 26, 2009

JRMC JRockit mission control, unable to connect console

still investigating on this problem, most likely I have not set -Xmanagement when running the WebLogic server... Thanks to the developers for the immense clarity of the error message.

Oh yes of course, you should change your startWebLogic.cmd adding
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xmanagement:ssl=false,authenticate=false,port=7099

once you restart weblogic, you should see this:
[INFO ][mgmnt  ] Remote JMX connector started at address esp50ws112345:7099
[INFO ][mgmnt  ] Local JMX connector started

Of course make sure you specify 7099 (and NOT 7001) in the JRMC client new connection parameters.


This was the original error message:

Could not open Management Console for frparmat01.acme.dns:8765.
  com.jrockit.mc.rjmx.ConnectionException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
    java.io.EOFException]
    com.jrockit.mc.rjmx.ConnectionException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
        java.io.EOFException]
        at com.jrockit.mc.rjmx.ConnectionManager.connect(ConnectionManager.java:63)
        at com.jrockit.mc.console.ui.actions.StartConsole$1.preConnect(StartConsole.java:38)
        at com.jrockit.mc.browser.utils.PreConnectJob.run(PreConnectJob.java:74)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
        java.io.EOFException]
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:317)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:229)
        at com.jrockit.mc.rjmx.internal.RJMXConnection.setupServer(RJMXConnection.java:537)
        at com.jrockit.mc.rjmx.internal.RJMXConnection.connect(RJMXConnection.java:144)
        at com.jrockit.mc.rjmx.internal.RJMXConnectorModel.establishConnection(RJMXConnectorModel.java:111)
        at com.jrockit.mc.rjmx.internal.RJMXConnectorModel.connect(RJMXConnectorModel.java:154)
        at com.jrockit.mc.rjmx.ConnectionManager.innerConnect(ConnectionManager.java:95)
        at com.jrockit.mc.rjmx.ConnectionManager.connect(ConnectionManager.java:61)
        ... 3 more
    Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
        java.io.EOFException]
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
        at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1817)
        at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1787)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:259)
        ... 10 more
    Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
        java.io.EOFException
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:93)
        ... 15 more
    Caused by: java.io.EOFException
        at java.io.DataInputStream.readByte(DataInputStream.java:243)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
        ... 19 more