堆快照标识符是否保证单调递增?

Are heap snapshot identifiers guaranteed to be monotonically increasing?

我正在使用堆快照来调试潜在的内存问题。如文档所示,对象以这种格式显示:

ObjectConstructorName@NumericIdentifier

其中 NumericIdentifier is:

This is an object ID. Displaying an object's address makes no sense, as objects are moved during garbage collections. Those object IDs are real IDs — that means, they persist among multiple snapshots taken. This allows precise comparison between heap states. Maintaining those IDs adds an overhead to GC cycles, but it is only initiated after the first heap snapshot was taken — no overhead if heap profiles aren't used.

我想知道是否保证标识符是单调递增的?即给出:

ObjectConstructorName@10001
ObjectConstructorName@10002

我可以相信第一个对象比第二个对象更旧(之前已分配)吗?

如果是 - 保证有多强? (例如,它是否包含在构造函数名称之间?)

正在跟进中。在与几位 V8 工程师交谈后:

  • 他们不确定保证目前是否有效。
  • 他们have/had没有计划做出这样的保证,也不是可以依靠的人。