Skip to content

zrlw/file-leak-detector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

file-leak-detector for WebSphere Application Server 8.5 (IBM JDK 1.6)

Java agent that detects file handle leak for WebSpere Application Server 8.5 (IBM JDK 1.6)
by Lao Wei(zrlw@sina.com) on Oct 01 21:19:00 GMT+8 2019

Build Steps at Eclipse with m2e plugin

  1. after git clone the project, you should change java.home in pom.xml to your Oracle JDK's JRE directory.
  2. Maven - Update Project... - OK
  3. Run as - Maven build...
  • in Main tab
    Goals: install -e
    checked 'Skip Tests' option
  • in JRE tab
    runtime JRE: Oracle JRE (suggest Oracle JRE 1.8)
  • click run button, it will download needed jars from maven repositories.
  1. after Build Success, configure project's build path, set JRE System library to IBM JDK 1.6
  2. Project - Clean
  3. Project - Build Project
  4. Export - Jar file - only export src/main/java
  5. edit the exported jar, add such contents to META-INF/MANIFEST.MF
Premain-Class: org.kohsuke.file_leak_detector.AgentMain
Agent-Class: org.kohsuke.file_leak_detector.AgentMain
Main-Class: org.kohsuke.file_leak_detector.Main
Can-Redefine-Classes: true
Can-Retransform-Classes: true
Built-By: your-name
  1. uncompress asm6 & args4j jar to a temp directory from your local repository which can be found in project build path.
  2. merge org directory of asm6 & args4j from the temp directory into the exported jar.
  3. copy the exported jar to the machine which run the WebSphere Application Server.
  4. logon WAS administrator console, set Java virtual machine of the WebSpere Application Server to debug mode.

Detector Method A:

1. add -javaagent:<your-path>/<your-jar>=http=<your-port>,host=<ip-of-WAS-machine> in general JVM parameters of the WAS.
2. start WAS
check <websphere_profile_home>/<node>/logs/<server>/native_stderr.log for error.

Detector Method B:

logon the account which run WAS process, run command:
<WAS-java-bin-path>/java -jar <your-path>/<your-jar> <WAS-PID> http=<your-port>,host=<ip-of-WAS-machine>

now open your browser, open http://<ip-of-WAS-machine>:<your-port> to get detector result.

About

Java agent that detects file handle leak

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%