paultanay opened a new pull request, #4335:
URL: https://github.com/apache/hertzbeat/pull/4335

   **What's changed?**
   
   `DataStorageDispatch.startPersistentDataStorage()` polls `MetricsData` 
objects from the queue and passes them through the history, plugin, and 
realtime writers, but never called `close()` afterward. `MetricsData` 
implements `AutoCloseable` and wraps an `ArrowTable` backed by Arrow column 
vectors — without `close()`, those vectors and their buffers are retained until 
GC decides to collect them. Under production load with many monitors this 
compounds into the steady heap growth reported in #4136.
   
   Wrapped the polled object in try-with-resources so `MetricsData.close()` is 
guaranteed on all exit paths: normal completion, writer exception, and thread 
interrupt. `DataStorageDispatch` is the terminal consumer, so closing here is 
safe.
   
   **Fixes:** #4136
   
   ---
   
   **Checklist**
   - [x] I have read the [contribution 
guidelines](https://hertzbeat.apache.org/docs/others/contributing)
   - [x] Existing tests pass (`hertzbeat-warehouse`, `hertzbeat-common-core`)


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to