From e8f215ae00e9efc9c3e967e0c37e77f6fd4cbbd3 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Mon, 1 Apr 2019 19:25:25 +0100 Subject: [PATCH] Forces the Garbage Collector to run after creating the DFs --- Rakefile | 2 +- app/controllers/enumeration.rb | 4 ++++ app/controllers/wp_version.rb | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 921aa024..21348df2 100644 --- a/Rakefile +++ b/Rakefile @@ -14,7 +14,7 @@ end begin require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) - # exec << :spec + exec << :spec rescue LoadError end diff --git a/app/controllers/enumeration.rb b/app/controllers/enumeration.rb index 8a5abe6c..989b003c 100644 --- a/app/controllers/enumeration.rb +++ b/app/controllers/enumeration.rb @@ -10,6 +10,10 @@ module WPScan def before_scan DB::DynamicFinders::Plugin.create_versions_finders DB::DynamicFinders::Theme.create_versions_finders + + # Force the Garbage Collector to run due to the above method being + # quite heavy in objects allocation + GC.start end def run diff --git a/app/controllers/wp_version.rb b/app/controllers/wp_version.rb index 6879bdf0..139d0972 100644 --- a/app/controllers/wp_version.rb +++ b/app/controllers/wp_version.rb @@ -18,6 +18,10 @@ module WPScan def before_scan WPScan::DB::DynamicFinders::Wordpress.create_versions_finders + + # Force the Garbage Collector to run due to the above method being + # quite heavy in objects allocation + GC.start end def run @@ -29,8 +33,6 @@ module WPScan show_progression: user_interaction? ) ) - - # GC.start end end end