Here's an snippet from a Ruby heap dump (generated with ObjectSpace.dump_all
{"address":"0x7fa2dadd7320", "type":"DATA", "class":"0x7fa3eb7ab408", "struct":"Google::Protobuf::Internal::Arena", "memsize":40}
{"address":"0x7fa2dadd1678", "type":"DATA", "class":"0x7fa3eb7ab408", "struct":"Google::Protobuf::Internal::Arena", "memsize":40}
{"address":"0x7fa2dadd3c70", "type":"DATA", "class":"0x7fa3eb7ab408", "struct":"Google::Protobuf::Internal::Arena", "memsize":40}
{"address":"0x7fa2dadcfaa8", "type":"DATA", "class":"0x7fa3eb7ab408", "struct":"Google::Protobuf::Internal::Arena", "memsize":40}
{"address":"0x7fa2dadc9c98", "type":"DATA", "class":"0x7fa3eb7ab408", "struct":"Google::Protobuf::Internal::Arena", "memsize":40}
{"address":"0x7fa2dadcb390", "type":"DATA", "class":"0x7fa3eb7ab408", "struct":"Google::Protobuf::Internal::Arena", "memsize":40}
As you can see, all these Google::Protobuf::Internal::Arena instances claim to be 40 bytes, which is obviously a lie.
This is because the memsize function is not defined:
|
{Arena_mark, Arena_free, NULL}, |
What language does this apply to?
Ruby
Describe the problem you are trying to solve.
I'd like to have a semi-accurate idea of how much memory the google-protobuf gem is holding onto.
Describe the solution you'd like
I'd like these functions to be defined (Arena, Message, etc). They don't have to be 100% accurate, not particularly fast. It's a debugging facility.
Describe alternatives you've considered
I don't see any.
cc @zhangskz because #9384 (comment)
Here's an snippet from a Ruby heap dump (generated with
ObjectSpace.dump_allAs you can see, all these
Google::Protobuf::Internal::Arenainstances claim to be 40 bytes, which is obviously a lie.This is because the
memsizefunction is not defined:protobuf/ruby/ext/google/protobuf_c/protobuf.c
Line 192 in 520c601
What language does this apply to?
Ruby
Describe the problem you are trying to solve.
I'd like to have a semi-accurate idea of how much memory the
google-protobufgem is holding onto.Describe the solution you'd like
I'd like these functions to be defined (
Arena,Message, etc). They don't have to be 100% accurate, not particularly fast. It's a debugging facility.Describe alternatives you've considered
I don't see any.
cc @zhangskz because #9384 (comment)