Prezados, bom tarde!
Estou tendo dificuldades para configurar o JBoss Profiler. Estou
seguindo o tutorial do jboss.org (no final do tópico). Ainda assim, ele não está rodando perfeitamente. Segue o tutorial no final do tópico, aqui vou colocando o que foi feito :
Configuração :
- java version “1.5.0_12”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot™ Client VM (build 1.5.0_12-b04, mixed mode, sharing) - jboss-4.0.5.GA.
- Ant 1.7.0
- jboss-profiler-1.0.RC3
- junit
[b]- Descompactei o conteúdo do arquivo “jboss-profiler-1.0.RC3”, na pasta do jboss.
- Rodei o “ant” dentro do diretório jboss_profiler/jvmti-src/.[/b]
- O ?ant? gerou alguns erros e pediu alguns arquivos que foram inseridos na pasta ?/jboss_profiler/jvmti-src/java-src/org/jboss/profiler/jvmti":
MemoryClass.java
MemoryObject.java
MemoryReference.java
MemoryReferenceSummary.java
MemorySnapshotController.java
MemorySnapshotEngine.java
ReferenceContainer.java
SPYConvertUtil.java
- O “ant” gerou um arquivo dentro do diretório jboss_profiler/jvmti-src/output/sars/ chamado “jboss-profiler-jvmti.sar”.
[b]- Compilei as bibliotecas nativas através do script ?compile.sh?.
- Inseri os arquivos indicados no diretório deploy.
- Meu PATH :[/b]
.bash_profile
User specific environment and startup programs
ANT_HOME=/var/java/ant
JAVA_HOME=/var/java/jdk
JUNIT_HOME=/var/java/junit
LD_LIBRARY_PATH=/var/java/jboss/jboss_profiler/jvmpi/linux/
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/java/jboss/jboss_profiler/jvmti/native/linux/
PATH=$JAVA_HOME/bin:$JUNIT_HOME/bin:$ANT_HOME/bin:$PATH:$HOME/bin
export JUNIT_HOME
export LD_LIBRARY_PATH
export ANT_HOME
export JAVA_HOME
export PATH
-
Meu run.conf :
JAVA_OPTS="-Xms128m -Xmx512m ?XrunjbossInspector:/tmp/profiler
-Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
-agentlib:jbossAgent" -
Ao tentar inserir o ?XrunjbossInspector:/tmp/profiler o seguinte erro é gerado : “Error occurred during initialization of VM
Could not find agent library on the library path or in the local
directory: jbossInspector” -
Visualizo no jmx-console (jboss.profiler) os mbeans : JVMTIClass e Native-profiler.
-
Acesso : http://localhost:8080/jboss-profiler - mas não tenho a mínima idéia de como mexer e não acho nenhum tutorial descente a respeito.
-
Não consigo acessar o link indicado : http://localhost:8080/jboss-inspector
[b]Se puderem me ajudar,
Att,
Mariana Hoffart Dias[/b]
BUILDING THE PROFILER
-
Build using ant. The built files will appear under the build/
directory. -
To compile the native library (DLL or .so), you have to use gcc.
Under
Windows use Cygwin with gcc installed and run the compile.sh script in
the
native/win32 directory. Under Linux/Unix, run the compile.sh script
in
the native/linux or native/solaris directory.
INSTALLATION
-
Once built, put jbossInspector.dll in your PATH (if you are using Windows) or libjbossInspector.so in your LD_LIBRARY_PATH (if you are using Linux/Unix.)
-
Copy the jboss-profiler.war file on your analysis system. Deploy
under a
standard web container. The jboss-provider.war file provides a front-
end for
analysis. When loaded, the front-end keeps the profile data loaded
entirely
in memory. You may have to allocate extra memory for the web
container.
(There is a class named “FileCollection” which uses the Tomcat’s
temporary file
system as a virtual memory buffer. You might want to clean that
directory
after running Jboss Profiler.)
USING THE PROFILER
- Add the -XrunjbossInspector:,<options…> as a
parameter to
your JVM. (Sun’s or IBM’s JVM)
Possible options include:
start=
include=
ignore=
socket=<server|IP>:
This option is used to be used in conjunction with
profilerConsole.jar. If
you use that option you have to include dpConsole.jar on the
class-path of your
application server.
uniqueNames=true
Useful for running test cases
wakeupOnStartup=true
Start the profiler always after the JVM start
memory=true|false (default=true)
Disable the memory profiler.
If this options is disable the profiler wouldn’t capture any
allocations events during data gathering
Example use:
java -XrunjbossInspector:/
tmp,include=org.jboss,ignore=*,start=org.jboss.mq.MQServer
These options only capture data for org.jboss classes (everything
else is
ignored with the ignore=* option). The “start” option will capture
data only
after org.jboss.mq.MQServer appears on your stack trace.
When running under JBoss, you can set the environment variable
JAVA_OPTS to
this parameter. Example use under Unix:
$ export JAVA_OPTS=-XrunjbossInspector:/
tmp,include=org.ex,ignore=*,start=org.ex.Main
- Start the data capturing. The profiler sleeps until you send a
signal.
If you use Sun’s JVM, send a signal using “kill -3” to start and
another “kill
-3” to finish capturing. (You have only one shot, as you can use
start option
to tell what you need to profile). CTRL-BREAK on Windows also sends
the same
signal.
If you use IBM’s JVM, use the option socket=server:port (e.g.
localhost:1000). Before
starting your JVM, execute:
java -jar dpConsole.jar 1000
Then tell the dpConsole.jar what PID you want to signal to start.
Alternatively, if you’re running the profiler under JBoss, you can
deploy
either jboss-profiler-noAOP.sar or jboss-profiler.sar and stop, start,
pause
the data capturing through JMX and the JMX console. The MBean has the
javax.management.ObjectName jboss.profiler:mbean=Native-profiler .
[TODO : discuss use of AOP capturing]
- After you have captured your .log.gz files you have to process
them by
using the front-end application. Access the analysis tool you
installed
previously.