[SERVER-9230] v8 ObjectTracker isn't tracking uncollected objects Created: 03/Apr/13  Updated: 11/Jul/16  Resolved: 04/Apr/13

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 2.4.1
Fix Version/s: 2.4.2, 2.5.0

Type: Bug Priority: Blocker - P1
Reporter: Ben Becker Assignee: Ben Becker
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

ObjTracker::track() fails to insert the tracked object into the set of tracked objects. This is causing memory to leak when script execution completes but the GC doesn't run.



 Comments   
Comment by auto [ 04/Apr/13 ]

Author:

{u'date': u'2013-04-03T20:50:46Z', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-9230: fix issue causing persistent v8 objects not to be tracked
Branch: v2.4
https://github.com/mongodb/mongo/commit/ee21ceb8d40329db2da65216b634c8f6f05628ab

Comment by auto [ 03/Apr/13 ]

Author:

{u'date': u'2013-04-03T20:50:46Z', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-9230: fix issue causing persistent v8 objects not to be tracked
Branch: master
https://github.com/mongodb/mongo/commit/ed3b8e1af9b629c99b433c818c0e9314bce405ee

Comment by Ben Becker [ 03/Apr/13 ]

Yes – all persistent objects point to c++ heap-allocated objects; e.g. BSONHolder, dbclientcursor, etc. For any scope which is destructed while an active reference exists to one of these handles, the GC callback will not be invoked and the object allocated on the C++ heap will never be freed.

Same holds true for a scope that was terminated.

Comment by Eric Milkie [ 03/Apr/13 ]

Could this leak be significant for some workloads? We seem to make decent use of Persistent objects in our v8 wrapper code.

Generated at Thu Feb 08 03:19:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.