mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Do not assume all interpreter versions support allocation tracing
This commit is contained in:
parent
fb60daa867
commit
2f75078758
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
||||||
if ENV['DISCOURSE_DUMP_HEAP'] == "1"
|
if ENV['DISCOURSE_DUMP_HEAP'] == "1"
|
||||||
require 'objspace'
|
require 'objspace'
|
||||||
|
begin
|
||||||
ObjectSpace.trace_object_allocations_start
|
ObjectSpace.trace_object_allocations_start
|
||||||
|
rescue NoMethodError
|
||||||
|
puts "Heap dumps not available for Ruby #{RUBY_VERSION} (> 2.1 required)"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
|
|
Loading…
Reference in a new issue