Class: GitLab::Exporter::WebExporter::RunGC

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_exporter/web_exporter.rb

Overview

Performs a major GC after each request. We found that this helps to free up several MB of memory in conjunction with sricter malloc config. See gitlab.com/gitlab-org/gitlab/-/issues/297241

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RunGC

Returns a new instance of RunGC.



42
43
44
# File 'lib/gitlab_exporter/web_exporter.rb', line 42

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



46
47
48
49
50
# File 'lib/gitlab_exporter/web_exporter.rb', line 46

def call(env)
  @app.call(env).tap do
    GC.start
  end
end