ninia / jep

Embed Python in Java
Other
1.28k stars 145 forks source link

Exception caught when I called SharedInterpreter.close() function with a High-frequency calling. #460

Closed nomiuo closed 1 year ago

nomiuo commented 1 year ago

Describe the bug I had an object pool in a python module which was imported into the SharedInterpreter. I don't know if this caused this exception.

When I created a SharedInterpreter, did sth and close it in one thread with a High-frequency calling, an execption was caught and raised.

Maybe the pyobject was changed in pool and the closing operation was done at the same time? image

The number of PyObjects was getting bigger quickly. image

After a while, my jvm crashed... image

Expected behavior How to fix it?

Environment (please complete the following information):

ndjensen commented 1 year ago

Why did you close the ticket? Are you synchronizing externally? We should be able to fix the ConcurrentModificationException. I'm not sure how much that relates to the crash, but it looks like MemoryManager isn't thread safe.

nomiuo commented 1 year ago

Sorry. I forgot to close the object, so the jvm crashed...