[ grinder-Bugs-3561156 ] Memory leak in MarkerFactory
SourceForge.net <[email protected]> Thu, 23 Aug 2012 18:55:23 -0700
| Newsgroups | gmane.comp.java.grinder.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3561156, was opened at 2012-08-23 18:55
Message generated for change (Tracker Item Submitted) made by ffan
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3561156&group_id=18598
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core engine
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Fei (ffan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Memory leak in MarkerFactory
Initial Comment:
As I use grinder for sink test with very high concurrency, the grinder reports OOM after around 15 minutes. I explored the vm map and find the problem is with the log marker. Grinder thread creates a log Marker for each thread run (ThreadContextImplementation.setCurrentRunNumber) and removes it from the thread Marker list on each new run, but the marker is not detached from the slf4j mark map. Thus, slf4j MarkerFactory will accumulate lots of unused markers.
I changed the ThreadContextImplementation.setCurrentRunNumber to the following to solve the problem:
@Override
public void setCurrentRunNumber(int run) {
if (m_runMarker != null) {
m_threadMarker.remove(m_runMarker);
+ // detach the thread-run marker from MarkerFactory
+ IMarkerFactory factory = MarkerFactory.getIMarkerFactory();
+ factory.detachMarker(m_runMarker.getName());
}
if (run != -1) {
m_runMarker = MarkerFactory.getMarker("run-" + run);
m_threadMarker.add(m_runMarker);
}
m_runNumber = run;
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3561156&group_id=18598
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/