Tagged: issue Toggle Comment Threads | Keyboard Shortcuts

  • Subinkrishna Gopi 11:37 am on February 23, 2010 Permalink |
    Tags: , help, htmlunit, issue, , , memory leak, ,   

    HTMLUnit issue 

    We are using HTMLUnit in one of our modules and we use it to crawl through the webpages. But we are facing serious memory leak issues with HTMLUnit. We are unable to kill the JavaScript threads even after the functionality is completed. All my search to fix this issue ended up in one solution,

    webClient.closeAllWindows();
    

    But even this did not help us in solving the leak. The method call claims to kill all the running JavaScript threads associated with the WebClient though! If anyone can help us in fixing this, can share their thoughts here. I will update this post as soon as we have a solution.

    Thank you.

    Advertisements
     
    • kkperf 11:28 pm on April 9, 2010 Permalink

      We seem to be running into a similar issue.
      We noticed “leaking windows” – always with a scriptable object tied to it. Here is what we did to confirm this (in addition to heap dump analysis)

      System.out.println(“windows size before closeAllWindows: ” + windows.size());
      webClient.closeAllWindows();
      System.out.println(“windows size after closeAllWindows: ” + windows.size());

      List windowsAfterClose = webClient.getWebWindows();
      System.out.println(“windowsAfterClose size: ” + windowsAfterClose.size());
      for (WebWindow ww : windowsAfterClose) {
      System.out.println(“Window name: ” + ww.getName());

      This shows that there is 1 window with no name still open.

      Trying to figure out whats going on. I’m going to perhaps end up logging a bug with htmlunit.
      Let me know if you have found a solution to the problem.
      Thanks
      -KK

    • kswenson 2:53 am on August 3, 2010 Permalink

      I have this exact problem.

      I have iterated through all the of the windows, gotten the ThreadManager, and interrupted all treads managed by those windows.

      Then I close all windows.

      But background JavaScript is still running. Every few seconds it creates a new thread and executes something.

      There is a class JavaScriptBackgroundJob which is running, but this class is not mentioned anywhere in the JavaDoc shipped with the library.

      I would appreciate help from anyone who can tell me how to COMPLETELY shut down all htmlunit processing.

    • Subinkrishna G 12:44 pm on August 4, 2010 Permalink

      We still dont have any solution 😦 I will update this post as soon as I have one.

  • Subinkrishna Gopi 2:35 pm on June 4, 2009 Permalink |
    Tags: , , issue, , , jdk   

    A small JBoss 5.1 issue 

    jbosscorp_logo

    I don’t know whether I should call it an issue. But for me it was an issue. Recently I switched to JBoss 5.1.0 GA. But when I tried to run it, it was throwing the following exception:

    [ClassLoaderManager] Unexpected error during load of:org.jboss.resource.metadata.repository.DefaultJCAMetaDataRepository
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
            at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572)
            at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
            at java.security.AccessController.doPrivileged(Native Method)

    You will have this problem if you are working with JDK 1.5.x. You can switch to JDK 1.6.x and you can get it working fine. But my entire work setup required me to run my Eclipse Ganymede on 1.5 but JBoss on 1.6. So I wrote a batch file which look like this:

    @echo off
    echo Overriding the Jboss home and Java home ...
    set JBOSS_HOME=D:\jboss-5.1.0.GA
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0
    echo Jboss home: %JBOSS_HOME%
    echo Java home: %JAVA_HOME%
    call %JBOSS_HOME%\bin\run.bat -b 192.168.x.y
    

    So I can have my Eclipse running on 1.5 with JBOSS_HOME set to JDK 1.5 and JBoss on 1.6. Hope this will be helpful for you in some way.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel