Updates:
        Status: Accepted
Cc: [email protected] [email protected] [email protected] [email protected]
        Labels: Type-Bug Priority-High HW-All

Comment #2 on issue 2073 by [email protected]: Garbage collector sometimes fails on objects with Object.defineProperty (memleak?)
http://code.google.com/p/v8/issues/detail?id=2073

function MyObject () {
  var self = this;
  Object.defineProperty(this, 'color', {
    get: function() { return 'red' }
  })
  setTimeout(function () {
    self.emit('close')
  }, 2000)
}

This constructor produces objects with different maps each time it is called. Map references getter callback, getter callback references function context, that references object itself (through variable self).

Some maps are retained because they got embedded into optimized code (e.g. addListener method of EventEmitter) as part of polymorphic call sequence (HandlePolymorphicCallNamed). Oracle returns a lot of maps so polymorphic call sequence is finished with IC not with an eager deoptimization. Thus those maps will be retained as long as optimized code exists.

Couple of maps is also retained by various monomorphic ICs used in non-optimized code, which we don't flush unless context was disposed (which never happens in this case).

Looping in some folks. Additional discussion is required to figure out how we are going to fix it.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to