rajat315315 opened a new pull request, #6731:
URL: https://github.com/apache/jmeter/pull/6731

   Closes: #6730 
   ## Description
   <!--- Provide a general summary of your changes in the Title above -->
   <!--- Describe your changes in detail here -->
   
   We have resolved the progressive memory leak in `CacheManager` by reusing a 
single `InheritableThreadLocal` instance and clearing per-thread state via 
`.remove()`. All changes have been tested, benchmarked under concurrent load, 
and committed on a dedicated branch.
   
   ---
   ## Motivation and Context
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ## How Has This Been Tested?
   <!--- Please describe in detail how you tested your changes. -->
   <!--- Include details of your testing environment, tests ran to see how -->
   <!--- your change affects other areas of the code, etc. -->
   
   ### Automated Unit Tests
   ```bash
   ./gradlew :src:protocol:http:test --tests 
"org.apache.jmeter.protocol.http.control.TestCacheManager*"
   ```
   
   **Output:**
   ```
   TestCacheManagerThreadIteration > testClearCacheReusesThreadLocalInstance() 
PASSED
   TestCacheManagerHC4 > testClearEachIteration() PASSED
   TestCacheManagerHC4 > testClear() PASSED
   ... (23 tests total)
   BUILD SUCCESSFUL in 51s
   ```
   
   ### Concurrent Benchmark Verification
   ```bash
   ./gradlew :src:protocol:http:test --tests 
"org.apache.jmeter.protocol.http.control.TestCacheManagerMemoryLeak"
   ```
   
   **Output:**
   ```
   TestCacheManagerMemoryLeak > 
testBenchmarkThreadLocalReuseUnderConcurrentLoad() PASSED
   BUILD SUCCESSFUL in 6s
   ```
   
   - **0 orphaned `InheritableThreadLocal` objects** left in worker threads.
   - Memory leak eliminated.
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Delete as appropriate 
-->
   - Bug fix (non-breaking change which fixes an issue)
   
   ## Checklist:
   <!--- Go over all the following points, and put an `x` in all the boxes that 
apply. -->
   <!--- If you're unsure about any of these, don't hesitate to ask. We're here 
to help! -->
   - [ ] My code follows the [code style][style-guide] of this project.
   - [ ] I have updated the documentation accordingly.
   
   [style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
   


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