Bug 50178

Summary: HeaderManager added as child of Thread Group can create concatenated HeaderManager names and OutOfMemoryException
Product: JMeter - Now in Github Reporter: Peter Lynch <plynch>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: 2.4   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X 10.5   

Description Peter Lynch 2010-10-29 01:20:58 UTC
1. Add a Header Manager as a direct child of a thread group. ( use case is test plan with multiple thread groups, each requiring diffferent headers.)
2. If multiple threads for thread group loop forever, each test iteration concats the Header manager's name to the previous name as part of merging header name/values. See line 315 of HeaderManager.java (scm 915405 )

This apparently is done to track that header manager's were merged. Problem is when cycling test iterations, this string keeps growing and growing forever - as long as the loop. Then you see crazy long log messages from line 666 (evil!) in HttpSamplerBase.java 

Given that the actual merge operation itself is logged, please remove the name concatenation during the merge operation so that there is no internal leak of memory for the HeaderManager name. Not doing this will eventually result in JMeter running out of memory allocating strings.
Comment 1 Sebb 2010-10-29 07:45:00 UTC
Note: the merge function was added as part of Bug 45479
Comment 2 Sebb 2010-10-29 19:53:08 UTC
The problem is really that the Header Manager sampler entry is not reset before the HMs are merged. Fixing this allows the updated name to work OK.

Added to SVN:


URL: http://svn.apache.org/viewvc?rev=1028948&view=rev
Log:
Bug 50178 - HeaderManager added as child of Thread Group can create concatenated HeaderManager names and OutOfMemoryException

Modified:
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/TestElement.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
   jakarta/jmeter/trunk/xdocs/changes.xml


Thanks for the bug report.
Comment 3 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2419