What are the meanings of the hash keys when calling ObjectSpace.count_objects?

前端 未结 3 1184
说谎
说谎 2021-01-12 07:18

In Ruby 1.9 (YARV) you can get a count of all currently allocated objects like so:

ObjectSpace.count_objects

which returns a hash like

3条回答
  •  执笔经年
    2021-01-12 08:12

    You can get more information about the T_DATA category by calling ObjectSpace.count_tdata_objects (described here).

    I believe that these are native objects controlled by the VM. Sometimes native extensions can allocate them, as well.

提交回复
热议问题