Kouhei Sutou
null+****@clear*****
Wed Jun 10 14:28:40 JST 2015
Kouhei Sutou 2015-06-10 14:28:40 +0900 (Wed, 10 Jun 2015) New Revision: 35d8b1ba909770abbe24801509c60fa40a7304ad https://github.com/ranguba/rroonga/commit/35d8b1ba909770abbe24801509c60fa40a7304ad Message: Free internal temporary objects immediately Modified files: lib/groonga/database-inspector.rb Modified: lib/groonga/database-inspector.rb (+11 -3) =================================================================== --- lib/groonga/database-inspector.rb 2015-06-10 14:15:05 +0900 (d23a0a5) +++ lib/groonga/database-inspector.rb 2015-06-10 14:28:40 +0900 (a0dc9a2) @@ -89,6 +89,10 @@ module Groonga end private + def push_memory_pool(&block) + @database.context.push_memory_pool(&block) + end + def report_plugins write("Plugins:\n") indent do @@ -236,7 +240,9 @@ module Groonga def count_total_n_columns @database.tables.inject(0) do |previous, table| - previous + table.columns.size + push_memory_pool do + previous + table.columns.size + end end end @@ -251,8 +257,10 @@ module Groonga end def count_total_table_disk_usage(table) - table.columns.inject(table.disk_usage) do |previous, column| - previous + column.disk_usage + push_memory_pool do + table.columns.inject(table.disk_usage) do |previous, column| + previous + column.disk_usage + end end end -------------- next part -------------- HTML����������������������������...Download