Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download the trial version of JProfiler http://www.ej-technologies.com/download/jprofiler/trial
  2. Watch this video for how to use it http://blog.ej-technologies.com/2009/04/in-screencast-below-i-show-strategy-for.html
  3. If for example the memory leak is in unit tests, you might insert the following code in the tear down method to cause the JVM to take a break between tests to allow you to manually run GC and see which objects created by the test were not cleaned up
    Code Block
    
        @After
        public void tearDown() throws Exception {
            testHelper.tearDown();
            helper.tearDown();
            System.out.println("force a GC here and see what objects remain that should not");
            try {
                InputStreamReader isr = new InputStreamReader(System.in);
                BufferedReader br = new BufferedReader(isr);
                System.out.println("Enter the line :- ");
                String s = br.readLine();
                System.out.println("You have Entered :- " + s);
    
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    

Scenario OutOfMemory exception due to heap space on the Bamboo build

...