Skip to content

[feat][Ruby] Support detecting GC state and handle it accordingly #936

@dalehamel

Description

@dalehamel

Ruby apps in production will spend a significant amount of their time in garbage collection.

When garbage collection runs, we currently will attribute the native frames to whatever ruby code happens to be in the interpreter. This is very misleading, as the code that is running didn't actually directly trigger GC. The ruby VM is what is deciding to run GC, so the native code that is running is really unrelated to the interpreter stack and combining them is conceptually invalid.

Stackprof profiler encountered essentially the same issue previously, and addressed this with tmm1/stackprof#87 which inserts "dummy" frames if GC is running, rather than collecting the stack traces and giving the impression that they are actually running.

I have already built support for this in:

Shopify#6

Which is based on #907, so I cannot open this PR yet until that lands. Just wanted to open this issue to note the problems with GC we currently have, and note that we already have a solution lined up for it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions