WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Classloader leak referenced by java.lang.invoke.ThunkTable

  • 1.  Classloader leak referenced by java.lang.invoke.ThunkTable

    Posted Thu October 06, 2022 02:41 AM
    I'm running the application below on tWASv9.

    demo_war (spring boot v2.7.3 + spring data jpa v2.7.2)

    Every time I restart the application, the application classloader is leaked with the following structure.

     
    com.ibm.ws.classloader.CompoundClassLoader @ 0x70f5e19e8 war:demo_war/demo.war
    '- <classloader>, <classLoader> class com.example.demo.EmpRepository @ 0x70b5e3910
    '- [0] java.lang.Class[2] @ 0x710990f28
    '- ptypes java.lang.invoke.MethodType @ 0x7136916b8
    '- extraObject java.lang.invoke.ThunkKeyWithObject @ 0x7109a2298
    '- key java.util.concurrent.ConcurrentHashMap$Node @ 0x710990f68
    '- [5] java.util.concurrent.ConcurrentHashMap$Node[16] @ 0x709fd4438
    '- table java.util.concurrent.ConcurrentHashMap @ 0x709fcb588
    '- tuples java.lang.invoke.ThunkTable @ 0x709a7dba8
    '- _thunkTable class java.lang.invoke.AsTypeHandle @ 0x7096d6568 System Class


    ------------------------------
    Yoshiki Yamada
    IBM Japan
    ------------------------------


  • 2.  RE: Classloader leak referenced by java.lang.invoke.ThunkTable
    Best Answer

    Posted Thu October 06, 2022 02:42 AM
    Solution:
    There is a JVM option to disable a cache in ThunkTable.

    -Dcom.ibm.jsr292.disableThunkSharing=true

    This will prevent the application class from being stored in the map of ThunkTable.


    ------------------------------
    Yoshiki Yamada
    IBM Japan
    ------------------------------