Aias00 opened a new issue, #6567:
URL: https://github.com/apache/shenyu/issues/6567

   ## Description
   Only the `LoadingCache<String, TarsInvokePrxList> cache` (line 82) has a 
`maximumSize`. Four companion maps (`ctxPathCache`, `prxClassCache`, 
`prxParamCache`, `refreshUpstreamCache`) have no maximumSize, no expiry, and no 
removal path. `invalidate(contextPath)` only calls `cache.invalidate(path)`. 
`prxClassCache` holds ByteBuddy-generated `Class<?>` objects loaded via 
`ClassLoadingStrategy.Default.INJECTION`; each retained `Class<?>` pins its 
class-loader and prevents metaspace GC.
   
   ## Location
   ```
   shenyu-plugin-tars/.../cache/ApplicationConfigCache.java:92,94,96,98 (maps), 
349-352 (invalidate only touches bounded LoadingCache)
   :269 (ClassLoadingStrategy.Default.INJECTION)
   ```
   
   ## Impact
   Long-lived deployments that add/remove Tars services (blue-green, ephemeral 
environments) leak generated Class objects + loaders forever -> eventual 
`Metaspace OOM`. Worst kind of leak (prevents metaspace reclamation).
   
   ## Suggested fix
   In `invalidate(contextPath)`, also remove `ctxPathCache.remove(contextPath)` 
and, for each MetaData in that list, `prxClassCache.remove(metaData.getPath())` 
and `prxParamCache` entries. Wire `TarsMetaDataHandler.remove` to the full 
cleanup.
   
   ## Related existing issue(s)
   None
   
   _Identified during the 2026-08-02 audit; full list in 
[`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.md)._


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to