anusha975 opened a new pull request, #17269:
URL: https://github.com/apache/iotdb/pull/17269

   This PR improves the SessionPoolExample by replacing the use of 
Executors.newFixedThreadPool() with a ThreadPoolExecutor backed by a bounded 
queue.
   
   Motivation:
   Executors.newFixedThreadPool internally uses an unbounded 
LinkedBlockingQueue, which may allow unlimited task accumulation and 
potentially lead to OutOfMemoryError in high-throughput scenarios.
   
   Since this is an official example, using a bounded queue demonstrates safer 
best practices for users.
   
   Changes:
   
   * Replace Executors.newFixedThreadPool with ThreadPoolExecutor
   * Use ArrayBlockingQueue with bounded capacity
   * Add explanatory comment
   
   This change only affects example code and does not modify core IoTDB 
functionality.
   


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