summaryrefslogtreecommitdiff
path: root/extractor/run_extractor.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-03-06 11:43:16 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-03-06 11:43:16 +0000
commit245e705ac7b6fca80a7aa4898f5467053ec2c585 (patch)
tree3034bcadfd9ed3778f1c89f5ea883270a3f64194 /extractor/run_extractor.cc
parent6717daa034bfcfa429275f64d84607ae1568d488 (diff)
Fix memory leak in trie.
Diffstat (limited to 'extractor/run_extractor.cc')
-rw-r--r--extractor/run_extractor.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc
index 36dbd7a0..5255737d 100644
--- a/extractor/run_extractor.cc
+++ b/extractor/run_extractor.cc
@@ -31,14 +31,6 @@ namespace fs = boost::filesystem;
namespace po = boost::program_options;
using namespace std;
-void my_pause() {
- cerr << "pausing..." << endl;
- for (int i = 0; i < 10000000; ++i) {
- cerr << endl;
- }
- cerr << "end pause" << endl;
-}
-
int main(int argc, char** argv) {
// TODO(pauldb): Also take arguments from config file.
po::options_description desc("Command line options");
@@ -122,7 +114,7 @@ int main(int argc, char** argv) {
cerr << "Reading alignment took "
<< GetDuration(start_time, stop_time) << " seconds" << endl;
- cerr << "Precomputating collocations..." << endl;
+ cerr << "Precomputing collocations..." << endl;
start_time = Clock::now();
shared_ptr<Precomputation> precomputation = make_shared<Precomputation>(
source_suffix_array,
@@ -150,6 +142,8 @@ int main(int argc, char** argv) {
<< GetDuration(preprocess_start_time, preprocess_stop_time)
<< " seconds" << endl;
+ cerr << "creating grammar extractor" << endl;
+
Clock::time_point extraction_start_time = Clock::now();
vector<shared_ptr<Feature> > features = {
make_shared<TargetGivenSourceCoherent>(),
@@ -176,6 +170,9 @@ int main(int argc, char** argv) {
vm["max_samples"].as<int>(),
vm["tight_phrases"].as<bool>());
+ // Release extra memory used by the initial precomputation.
+ precomputation.reset();
+
int grammar_id = 0;
fs::path grammar_path = vm["grammars"].as<string>();
if (!fs::is_directory(grammar_path)) {