[ 
https://issues.apache.org/jira/browse/GROOVY-11240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Sun updated GROOVY-11240:
--------------------------------
    Description: 
We should keep the DFA cache as long as possible for better parsing 
performance, but the DFA cache may be very huge and results in OOM usually if 
we do not handle it correctly.

Our current solution is to set a threshold to cleanup DFA cache, but the 
threshold is hard for users to evaluate for a reasonable value.

The new solution relies on GC, if the object referenced by soft reference is 
collected by GC, we trigger the cleanup of DFA cache. We just need set the 
threshold to {{0}} to enable the smart cleanup.

For better compatibility, we keep the existing cleanup setting as it is.

  was:
We should keep the DFA cache as possible as we could for better parsing 
performance, but the DFA cache may be very huge and results in OOM usually.

Our current solution is to set a threshold to cleanup DFA cache, but the 
threshold is hard for users to evaluate reasonable value.

The new solution relies on GC, if the object referenced by soft reference is 
collected by GC, we trigger the cleanup of DFA cache. We just need set the 
threshold to {{0}} to enable the smart cleanup.

For better compatibility, we keep the existing cleanup as it is.


> Tweak cleanup DFA cache of parser
> ---------------------------------
>
>                 Key: GROOVY-11240
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11240
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 5.0.0-alpha-4
>
>
> We should keep the DFA cache as long as possible for better parsing 
> performance, but the DFA cache may be very huge and results in OOM usually if 
> we do not handle it correctly.
> Our current solution is to set a threshold to cleanup DFA cache, but the 
> threshold is hard for users to evaluate for a reasonable value.
> The new solution relies on GC, if the object referenced by soft reference is 
> collected by GC, we trigger the cleanup of DFA cache. We just need set the 
> threshold to {{0}} to enable the smart cleanup.
> For better compatibility, we keep the existing cleanup setting as it is.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to