reckart opened a new issue, #371:
URL: https://github.com/apache/uima-uimaj/issues/371

   **Describe the bug**
   When repeatedly creating type system instances with lots of classes on a 
Java 17+ system, it appears that the JVM class metaspace can be exhausted.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Create a large type system description
   2. Repeatedly create type systems from that description
   3. Monitor class metaspace
   
   Diagnosis so far: it appears that 
`TypeSystemImpl.computeAdjustedFeatureOffsets()` will always initialize the 
`type2jcci` map of the `TypeSystemImpl` instance. As part of this, 
`FSClassRegistry.createJCasClassInfo()` is repeatedly called which creates new 
generator callsites (lambdas) that start clogging up the metaspace.
   
   It seems this may be related to 
[JDK-8302154](https://bugs.openjdk.org/browse/JDK-8302154) - before Java 15 
apparently these callsites could be easily garbage collected and now this is 
more difficult.
   
   **Expected behavior**
   A solution might be to use the global JCCI cache  maintained in 
`FSClassRegistry` when populating the `TypeSystemImpl.type2jcci` maps to avoid 
repeatedly creating the generator lambdas.
   
   **Please complete the following information:**
    - Version: 3.5.0
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@uima.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to