[SERVER-1827] Memory leak when there's multiple query plans with empty result Created: 22/Sep/10 Updated: 12/Jul/16 Resolved: 26/Oct/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Stability |
| Affects Version/s: | 1.6.2 |
| Fix Version/s: | 1.6.4, 1.7.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Constantine Verutin | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Participants: |
| Description |
|
Steps to reproduce: > db.tst.insert({_id: "foo", k: "bar"}) Every such find() statement produces a leak of 32k bytes(see the very last record in attached valgrind log) The problem is that in UserQueryOp::finish(), when appending data to message, there's no check if data length is 0. Here's the code: else { _response.appendData( _buf.buf(), _buf.len() ); _buf.decouple(); }– I was able to reproduce this on 1.6.2 and git master, patch against master is attached. |
| Comments |
| Comment by auto [ 26/Oct/10 ] |
|
Author: {'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}Message: Plug memory leak |
| Comment by Dwight Merriman [ 18/Oct/10 ] |
|
i assume so given fix version isn't marked as 1.6.3 above... |
| Comment by Fabio Ferrari [ 08/Oct/10 ] |
|
Using valgrind I can see leaks of 32k in queries using the 1.6.3. Same problem? |
| Comment by Mathias Stearn [ 22/Sep/10 ] |
|
Thanks for the patch |
| Comment by auto [ 22/Sep/10 ] |
|
Author: {'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}Message: Plug memory leak |