[JAVA-1519] DBCursor finalizer should not hold on to the query results Created: 27/Oct/14 Updated: 30/Jan/15 Resolved: 28/Oct/14 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Query Operations |
| Affects Version/s: | None |
| Fix Version/s: | 2.13.0, 3.0.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
DBCursor has a field that is populated with an instance of a class with a finalize() method, which is used to close a dangling cursor. But the class is an inner class, and therefore references the DBCursor instance, which in turn references the last query batch. This stresses out the garbage collector, which now has to keep all those objects alive until finalize() is called. A better design would be to make the class with the finalizer a static inner class that only references the cursor id and server address. |
| Comments |
| Comment by Githook User [ 30/Jan/15 ] |
|
Author: {u'username': u'evanchooly', u'name': u'Justin Lee', u'email': u'jlee@antwerkz.com'}Message: Merge pull request #272 from jyemin/j1519
|
| Comment by Githook User [ 30/Jan/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: DBCursor's OptionalFinalizer inner class is now static and only contains fields for a Mongo instance and a ServerCursor instance. |
| Comment by Jeffrey Yemin [ 29/Jan/15 ] |
|
2.13.0 has been released. Closing issue. |
| Comment by Githook User [ 28/Oct/14 ] |
|
Author: {u'username': u'evanchooly', u'name': u'Justin Lee', u'email': u'jlee@antwerkz.com'}Message: Merge pull request #272 from jyemin/j1519
|
| Comment by Githook User [ 28/Oct/14 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: DBCursor's OptionalFinalizer inner class is now static and only contains fields for a Mongo instance and a ServerCursor instance. |
| Comment by Githook User [ 28/Oct/14 ] |
|
Author: {u'username': u'evanchooly', u'name': u'Justin Lee', u'email': u'jlee@antwerkz.com'}Message: Merge pull request #274 from jyemin/
|
| Comment by Githook User [ 28/Oct/14 ] |
|
Author: {u'username': u'evanchooly', u'name': u'Justin Lee', u'email': u'jlee@antwerkz.com'}Message: Merge pull request #274 from jyemin/
|
| Comment by Githook User [ 28/Oct/14 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: DBCursor's OptionalFinalizer inner class is now static and only contains fields necessary to kill the cursor. |
| Comment by Jeffrey Yemin [ 27/Oct/14 ] |