4666 Ole John Aske 2011-11-14
Fix: SPJ may leak RowMaps
There is a minor memory leak of 'struct RowMap' objects.
As the RowMap was only ::init()'ed when Dbspj::releaseNodeRows() has
released all the mapped rows, its reference was effectively lost
at that point and another RowMap will be allocated if needed
... NOTE: 'leak' in this context is not a true memory leak
as all memory is managed within the request and released
when ::cleanup() removes all objects related to this request.
modified:
storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
4665 Jonas Oreland 2011-11-14
ndb - lqh++ - this patch takes parts of mikaels patch to allow more then 4 lqh threads. Namely adds infrastructure to make redo-log-parts configurable
modified:
storage/ndb/include/kernel/ndb_limits.h
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
storage/ndb/include/ndb_version.h.in
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/vm/GlobalData.hpp
=== modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-11-09 13:10:53 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-11-14 14:18:01 +0000
@@ -1532,7 +1532,17 @@ Dbspj::releaseNodeRows(Ptr<Request> requ
releaseRow(requestPtr, pos);
cnt++;
}
- treeNodePtr.p->m_row_map.init();
+
+ // Release the (now empty) RowMap
+ RowMap& map = treeNodePtr.p->m_row_map;
+ if (!map.isNull())
+ {
+ jam();
+ RowRef ref;
+ map.copyto(ref);
+ releaseRow(requestPtr, ref); // Map was allocated in row memory
+ map.init();
+ }
DEBUG("RowMapIterator: released " << cnt << " rows!");
}
}
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (ole.john.aske:4665 to 4666) | Ole John Aske | 14 Nov |