From 5213dceabcb5e0dd2ce168d0c0aaed1457e150b6 Mon Sep 17 00:00:00 2001 From: Tomo Krajina Date: Sat, 27 Jan 2018 10:04:36 +0100 Subject: [PATCH] Increase heap space, logs --- tatoebaimporter/build.gradle | 4 ++++ .../a10000sentences/importer/importers/Import.java | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tatoebaimporter/build.gradle b/tatoebaimporter/build.gradle index f9def49..40747d0 100644 --- a/tatoebaimporter/build.gradle +++ b/tatoebaimporter/build.gradle @@ -2,6 +2,10 @@ apply plugin:'application' mainClassName = "info.puzz.a10000sentences.importer.importers.Import" compileJava.options.encoding = 'UTF-8' +tasks.withType(JavaExec) { + jvmArgs = ['-Xms4G', '-Xmx4G'] +} + dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) diff --git a/tatoebaimporter/src/main/java/info/puzz/a10000sentences/importer/importers/Import.java b/tatoebaimporter/src/main/java/info/puzz/a10000sentences/importer/importers/Import.java index 630d3b2..5acdea5 100644 --- a/tatoebaimporter/src/main/java/info/puzz/a10000sentences/importer/importers/Import.java +++ b/tatoebaimporter/src/main/java/info/puzz/a10000sentences/importer/importers/Import.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.ThreadUtils; import java.io.File; import java.nio.file.Paths; @@ -91,10 +92,13 @@ public static void main(String[] args) throws Exception { Set languages = new HashSet<>(); - for (Importer importer : importers) { + for (int i = 0; i < importers.size(); i++) { + Importer importer = importers.get(i); + String outFilename = String.format("%s-%s.csv", importer.knownLanguageAbbrev3, importer.targetLanguageAbbrev3); + System.out.println(String.format("Language %d/%d: %s", i + 1, importers.size(), outFilename)); + languages.add(importer.targetLang.getName()); languages.add(importer.knownLang.getName()); - String outFilename = String.format("%s-%s.csv", importer.knownLanguageAbbrev3, importer.targetLanguageAbbrev3); SentenceWriter writer = new SentenceWriter(Paths.get(OUTPUT_DIR, outFilename).toString()); importer.importCollection(writer); @@ -107,6 +111,9 @@ public static void main(String[] args) throws Exception { .setType(importer.getType()) .setFilename(new File(writer.filename).getName()); info.addSentencesCollection(collection); + + System.out.println("cooling cpu :)"); + Thread.sleep(10_000); } Object[] langArr = languages.toArray();