Bug? Memory leak?

Discussion in 'B4J Bugs & Wishlist' started by Bruce Axtens, Feb 25, 2015.

  1. Bruce Axtens

    Bruce Axtens Active Member Licensed User

    My BOJ project is on screen at the moment doing nothing but waiting for me to hit "Save" or "Cancel". However, I have Java VisualVM open and it's watching BOJ slowly consume more and more heap. This seems a bit anomalous as there's nothing happening in my code; whatever's chewing RAM is doing it in the background/daemon code. In the time it's taken to get this email written the Heap Size has climbed to 200MB. This would explain why BOJ eventually locks-up if I don't respond to it immediately.

    Screen shot and project archive attached.

    Kind regards,
    Bruce.
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you testing it in Release mode? Can you upload the two additional libraries it uses?
     
  3. Bruce Axtens

    Bruce Axtens Active Member Licensed User

    Yes, it is a release mode .jar that is running. Additional libraries in others.zip.
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    I don't see any potential memory leak here.

    I've even limited the heap size to 16mb with this command line:
    java -Xmx16m -jar BOJ.jar

    [​IMG]

    The question is whether you get an out of memory error or not. Run it from the command line to test it.
     
  5. Bruce Axtens

    Bruce Axtens Active Member Licensed User

    Thanks, Erel.

    I've been using JavaW.exe to interpret the .jar file. Is that wrong? Should I be using something else? The graphic shows how it's defined in Task Scheduler.

    If I use java.exe won't that popup a cmd window while the program runs?
     

    Attached Files:

    Last edited: Feb 25, 2015
  6. Erel

    Erel Administrator Staff Member Licensed User

    You should use javaw. However in order to see error messages you can run it with java.exe instead. The only difference is whether a console is created or not.
     
  7. Bruce Axtens

    Bruce Axtens Active Member Licensed User

    It might be cheating, but I achieved this by pasting in a large blob of text.

    Code:
    Exception in thread "JavaFX Application Thread" java.lang.OutOfMemoryError: Java heap space
            at com.sun.glass.ui.win.WinSystemClipboard.popBytes(Native Method)
            at com.sun.glass.ui.win.WinSystemClipboard.popFromSystem(Unknown Source)
            at com.sun.glass.ui.SystemClipboard.getData(Unknown Source)
            at com.sun.glass.ui.ClipboardAssistance.getData(Unknown Source)
            at com.sun.javafx.tk.quantum.QuantumClipboard.getContent(Unknown Source)
            at javafx.scene.input.Clipboard.getContentImpl(Unknown Source)
            at javafx.scene.input.Clipboard.getContent(Unknown Source)
            at javafx.scene.input.Clipboard.getString(Unknown Source)
            at com.sun.javafx.webkit.PasteboardImpl.getPlainText(Unknown Source)
            at com.sun.webkit.WCPasteboard.getPlainText(Unknown Source)
            at com.sun.webkit.WebPage.twkProcessKeyEvent(Native Method)
            at com.sun.webkit.WebPage.dispatchKeyEvent(Unknown Source)
            at javafx.scene.web.WebView.processKeyEvent(Unknown Source)
            at javafx.scene.web.WebView.lambda$registerEventHandlers$
    31(Unknown Source)
            at javafx.scene.web.WebView$$Lambda$
    93/12265642.handle(Unknown Source)
            at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
            at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
            at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
            at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
            at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
            at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
            at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
            at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
     
  8. Bruce Axtens

    Bruce Axtens Active Member Licensed User

    I then deleted all the text, and pasted in the above error message until the following appeared
    Code:
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (
    0xc0000005) at pc=0x6d39d16e, pid=16104, tid=8004
    #
    # JRE version: Java(TM) SE Runtime Environment (
    8.0_31-b13) (build 1.8.0_31-b13)
    # Java VM: Java HotSpot(TM) Client VM (
    25.31-b07 mixed mode, sharing windows-x86 )
    # Problematic frame:
    # C  [jfxwebkit.dll+
    0x40d16e]
    #
    # Failed 
    to write core dump. Minidumps are not enabled by default on client versions of Windows
    #
    # An error report 
    file with more information is saved as:
    # C:\Users\Bugmagnet\.joblog\hs_err_pid16104.log
    #
    If you would like to submit a bug report, please visit:
    #   http://bugreport.java.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine 
    in native code.
    # See problematic frame 
    for where to report the bug.
    #
     

    Attached Files:

  9. Erel

    Erel Administrator Staff Member Licensed User

    This doesn't mean that there is a memory leak.

    It means that there wasn't enough memory for the HtmlEditor(?) to handle the text.
     
  10. Bruce Axtens

    Bruce Axtens Active Member Licensed User

    Oops. Ok, will have to find a server to put the code on and let it run "forever" there. Sorry.
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice