Clarity

 View Only
  • 1.  Java memory leaking in Clarity 15.7

    Posted Oct 05, 2020 06:03 AM
    Hello folks,
    ​We have a issue caused by java memory leaking. We cannot access to our ppm application.
    I have incresed the memory of the java vm and restarted the services but we still have the problem.
    Any recommandations will be helpful.

    Many thnaks in advance.

    Regards

    Karim


  • 2.  RE: Java memory leaking in Clarity 15.7

    Broadcom Employee
    Posted Oct 05, 2020 06:16 AM

    Increase memory utilization doesn't conclude its a memory leak, the very first step I would recommend is to set up a heap dump and let the app get into out of memory and have us review the heap dump 

     



    ------------------------------
    Thanks & Regards
    Suman Pramanik
    Sr. Principal Support Engineer | Customer Success & Support, Enterprise Software Division
    Broadcom
    ------------------------------



  • 3.  RE: Java memory leaking in Clarity 15.7

    Posted Oct 06, 2020 06:35 AM
    Edited by Nick Darlington Oct 06, 2020 06:36 AM
    I have a minor doubt on this article that may need adjusting please.  If my own memory hasn't leaked that is!

    https://knowledge.broadcom.com/external/article/20405/how-to-generate-a-java-heap-dump-on-outo.html

    On option 1 it states the dump file will get overwritten; I thought the opposite was true and that it wouldn't write the heap dump if a matching filename was already present.

    Example:
    C:\>java -Xmx2m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./test.hprof OOM
    java.lang.OutOfMemoryError: Java heap space
    Dumping heap to ./test.hprof ...
    Heap dump file created [2343574 bytes in 0.008 secs]
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.base/jdk.internal.misc.Unsafe.allocateUninitializedArray0(Unsafe.java:1276)
    at java.base/jdk.internal.misc.Unsafe.allocateUninitializedArray(Unsafe.java:1269)
    at java.base/java.lang.invoke.StringConcatFactory$MethodHandleInlineCopyStrategy.newArray(StringConcatFactory.java:1633)
    at java.base/java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(DirectMethodHandle$Holder)
    at java.base/java.lang.invoke.LambdaForm$MH/0x0000000100064840.invoke(LambdaForm$MH)
    at java.base/java.lang.invoke.Invokers$Holder.linkToTargetMethod(Invokers$Holder)
    at OOM.main(OOM.java:5)

    C:\>java -Xmx2m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./test.hprof OOM
    java.lang.OutOfMemoryError: Java heap space
    Dumping heap to ./test.hprof ...
    Unable to create ./test.hprof: File exists
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.base/jdk.internal.misc.Unsafe.allocateUninitializedArray0(Unsafe.java:1276)
    at java.base/jdk.internal.misc.Unsafe.allocateUninitializedArray(Unsafe.java:1269)
    at java.base/java.lang.invoke.StringConcatFactory$MethodHandleInlineCopyStrategy.newArray(StringConcatFactory.java:1633)
    at java.base/java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(DirectMethodHandle$Holder)
    at java.base/java.lang.invoke.LambdaForm$MH/0x0000000100064840.invoke(LambdaForm$MH)
    at java.base/java.lang.invoke.Invokers$Holder.linkToTargetMethod(Invokers$Holder)
    at OOM.main(OOM.java:5)


    Note the second time it fails due to: Unable to create ./test.hprof: File exists

    It doesn't overwrite.


  • 4.  RE: Java memory leaking in Clarity 15.7

    Posted Oct 06, 2020 06:13 AM
    If your logs are indicating a java.lang.OutOfMemoryError has occurred, then capturing a heap dump at that exact time would be best as Suman suggests.

    Note that Clarity doesn't come configured out of the box with this enabled, you have to put in the parameters and configure an appropriate path for it to use.

    This knowledge article may help guide you with that if further information is needed:

    https://knowledge.broadcom.com/external/article/20405/how-to-generate-a-java-heap-dump-on-outo.html

    I suggest going with option 2 to use the folder based configuration in that article, provided you have ample storage space in the location chosen.

    Once you get a dump file in this way, it is strongly recommended to open a support ticket with Broadcom and have them analyze it as it requires inside knowledge of the system to correctly identify what is normal vs. abnormal in the dumps generated.


  • 5.  RE: Java memory leaking in Clarity 15.7

    Posted Oct 06, 2020 11:15 AM
    Thanks Suman and Nick for your recommendations.
    I will set up a heap dump and I let you know.