mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -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"
|
||||
require 'objspace'
|
||||
ObjectSpace.trace_object_allocations_start
|
||||
begin
|
||||
ObjectSpace.trace_object_allocations_start
|
||||
rescue NoMethodError
|
||||
puts "Heap dumps not available for Ruby #{RUBY_VERSION} (> 2.1 required)"
|
||||
end
|
||||
end
|
||||
|
||||
require 'rubygems'
|
||||
|
|
Loading…
Reference in a new issue