Jump to: navigation, search

Difference between revisions of "MemoryAnalyzer/Contributor Reference"

(added a link to a new page about writing plugins for MAT (page was created by me), hopefully it will be useful to someone)
(Setup)
Line 8: Line 8:
  
 
Install Eclipse and configure it to develop Java 5 applications.
 
Install Eclipse and configure it to develop Java 5 applications.
* We usually use [http://download.eclipse.org/eclipse/downloads/ Eclipse 3.4 (Ganymede)]. However, as of today, a 3.3er release works just as well.
+
* We usually use [http://download.eclipse.org/eclipse/downloads/ Eclipse 3.6 (Helios)]. However, as of today, a 3.5, 3.4 or perhaps a 3.3 release works.
  
 
Setup your development environment:
 
Setup your development environment:
Line 15: Line 15:
 
** SVN Team Provider  
 
** SVN Team Provider  
 
** Subversive SVN Connectors (See [http://www.eclipse.org/subversive/downloads.php Subversion Team Provider] Download Page for the Update Site URL)
 
** Subversive SVN Connectors (See [http://www.eclipse.org/subversive/downloads.php Subversion Team Provider] Download Page for the Update Site URL)
** IBM Diagnostic Tool Framework for Java (See [http://www.ibm.com/developerworks/java/jdk/tools/dtfj.html IBM Diagnostic Tool Framework for Java Version 1.3] to find the archived Update Site.) This is needed to compile and run with the DTFJ adapter which is part of Memory Analyzer and allows Memory Analyzer to read dumps from IBM virtual machines for Java.
+
** IBM Diagnostic Tool Framework for Java (See [http://www.ibm.com/developerworks/java/jdk/tools/dtfj.html IBM Diagnostic Tool Framework for Java Version 1.4] to find the archived Update Site.) This is needed to compile and run with the DTFJ adapter which is part of Memory Analyzer and allows Memory Analyzer to read dumps from IBM virtual machines for Java.
 
* Configure the Code Formatter Template:
 
* Configure the Code Formatter Template:
 
** ''Preferences -> Java -> Code Style -> Formatter -> Import...'' and import this [http://www.eclipse.org/mat/dev/mat_code_formatter.xml template].
 
** ''Preferences -> Java -> Code Style -> Formatter -> Import...'' and import this [http://www.eclipse.org/mat/dev/mat_code_formatter.xml template].

Revision as of 08:42, 8 October 2010

Getting Started

This page is meant to help you contribute to the Memory Analyzer project.

Workspace

Setup

Install Eclipse and configure it to develop Java 5 applications.

  • We usually use Eclipse 3.6 (Helios). However, as of today, a 3.5, 3.4 or perhaps a 3.3 release works.

Setup your development environment:

  • Via the Update Manager Help -> Software Updates... install:
    • Eclipse BIRT Chart Runtime Feature
    • SVN Team Provider
    • Subversive SVN Connectors (See Subversion Team Provider Download Page for the Update Site URL)
    • IBM Diagnostic Tool Framework for Java (See IBM Diagnostic Tool Framework for Java Version 1.4 to find the archived Update Site.) This is needed to compile and run with the DTFJ adapter which is part of Memory Analyzer and allows Memory Analyzer to read dumps from IBM virtual machines for Java.
  • Configure the Code Formatter Template:
    • Preferences -> Java -> Code Style -> Formatter -> Import... and import this template.

Checkout

As the project is still in incubation, you'll find only the trunk code line. Check out the projects by saving mat.psf file locally, and then using File -> Import -> Team Project Set. Use user name "anonymous" and an empty password.

More infos: SVN_Howto, Web Access

Launch Configuration

Launch the Memory Analyzer as stand-alone RCP:

  • Create a new Eclipse Application configuration
  • Run a product: org.eclipse.mat.ui.rcp.MemoryAnalyzer
  • Launch with: plug-ins selected below only
    • Deselect org.eclipse.mat.tests
    • Deselect Target Platform and click Add Required Plug-ins
    • Select org.eclipse.pde.runtime (3.3) or org.eclipse.ui.views.log (3.4) to include the Error Log
    • Select com.ibm.dtfj.j9 com.ibm.dtfj.phd com.ibm.dtfj.sov if you have installed the IBM DTFJ feature and wish to process dumps from IBM virtual machines
    • Select com.ibm.java.doc.tools.dtfj for help for IBM DTFJ

or as feature plugged into the IDE:

  • Create a new Eclipse Application configuration
  • Run a product: org.eclipse.sdk.ide
  • Launch with: plug-ins selected below only
    • Deselect org.eclipse.mat.tests and org.eclipse.mat.ui.rcp
    • Select com.ibm.dtfj.api com.ibm.dtfj.j9 com.ibm.dtfj.phd com.ibm.dtfj.sov if you have installed the IBM DTFJ feature and wish to process dumps from IBM virtual machines
    • Select com.ibm.java.doc.tools.dtfj for help for IBM DTFJ

Export Stand-Alone RCP

To export the RCP, you need an Eclipse 3.4 IDE setup as described above.

Then open org.eclipse.mat.ui.rcp/mat.product and use the Eclipse Product Export Wizard to build the RCP.

JUnit Tests

The unit tests a placed in the org.eclipse.mat.tests project. Execute the tests by right-clicking on the project and choose Run As... -> JUnit Plug-in Test.

Build Help with DITA

  • Download DITA-OT1.4.2.1 and unzip it into C:\DITA-OT1.4.2.1
  • In plugin org.eclipse.mat.ui.help select DitaBuild.xml and configure the runtime configuration:
    • right click Run As > Ant Build...
    • add all the libraries from C:\DITA-OT1.4.2.1\lib into the classpath
  • To modify Help documentation modify xml files
    • Download XMLBuddy and copy a product directory (e.g., com.objfac.xmleditor_2.0_72) to the plugins directory of your Eclipse installation.
    • Configure XMLBuddy editor as described here
  • Run ant on DitaBuild.xml to build html files.

Ideas for Contributions

This is just a short list of ideas. If you are missing a feature and have some time to contribute, please do not hesitate to contact us.

  • Extensions to the tool adding application knowledge: MAT provides some extension points which can help you to plug-in pieces of information that give meaning to your specific object structures. It would be nice to have in MAT application knowlegde about prominent open source projects, e.g. different Eclipse components, servers like Tomcat and Glassfish, etc... Some examples:
    • using an org.eclipse.mat.api.nameResolver extension one can specify what description should be shown next to an object, similar to a toString() method. See for example bug 273915
    • using an org.eclipse.mat.api.requestResolver extension one can add to the leak report information about what a threads was executing, e.g. tell which HTTP request it was processing, list the URL, parameters, etc... For example bug 318989 proposes an extension which points to the ruby script a thread is executing
    • using an org.eclipse.mat.api.query extension one can add a useful query which will be available all the other queries/commands seen in the tool. See for example bug 256154
  • Documentation
  • Unit Tests

Writing plugins for the Memory Analyzer

If you want to write a plugin for the Memory Analyzer, the page MemoryAnalyzer/Writing_plugins_for_the_Memory_Analyzer might be of use to you.