What is 'JNI Global reference'

后端 未结 3 647
面向向阳花
面向向阳花 2020-12-05 07:14

I am using jProfiler to find memory leaks in a Java swing application. I have identified instances of a JFrame which keeps growing in count.

This frame is opened, an

3条回答
  •  借酒劲吻你
    2020-12-05 08:03

    I had this exact problem when fixing memory leaks in a JavaFX application. In the end the problem turned out to be that i was running the application in debug mode and had several breakpoints in the code. This seems to have caused objects to be 'JNI Global reference' and being kept in memory without apparent reason. When i turned off the debug mode everything worked as it should!

提交回复
热议问题