diff --git a/main/src/com/google/refine/importing/ImportingUtilities.java b/main/src/com/google/refine/importing/ImportingUtilities.java index e44596919..721e223b4 100644 --- a/main/src/com/google/refine/importing/ImportingUtilities.java +++ b/main/src/com/google/refine/importing/ImportingUtilities.java @@ -635,7 +635,7 @@ public class ImportingUtilities { static public String getEncoding(JSONObject fileRecord) { String encoding = JSONUtilities.getString(fileRecord, "encoding", null); - if (encoding == null) { + if (encoding == null || encoding.isEmpty()) { encoding = JSONUtilities.getString(fileRecord, "declaredEncoding", null); } return encoding; @@ -942,5 +942,7 @@ public class ImportingUtilities { } JSONUtilities.safePut(progress, "message", message); JSONUtilities.safePut(progress, "percent", percent); + JSONUtilities.safePut(progress, "memory", Runtime.getRuntime().totalMemory() / 1000000); + JSONUtilities.safePut(progress, "maxmemory", Runtime.getRuntime().maxMemory() / 1000000); } } diff --git a/main/webapp/modules/core/scripts/index/create-project-progress-panel.html b/main/webapp/modules/core/scripts/index/create-project-progress-panel.html index f37b296c4..7b97d7eb3 100644 --- a/main/webapp/modules/core/scripts/index/create-project-progress-panel.html +++ b/main/webapp/modules/core/scripts/index/create-project-progress-panel.html @@ -7,6 +7,7 @@ + diff --git a/main/webapp/modules/core/scripts/index/create-project-ui.js b/main/webapp/modules/core/scripts/index/create-project-ui.js index b448f5a4f..ed6b8d023 100644 --- a/main/webapp/modules/core/scripts/index/create-project-ui.js +++ b/main/webapp/modules/core/scripts/index/create-project-ui.js @@ -228,6 +228,7 @@ Refine.CreateProjectUI.prototype.pollImportJob = function(start, jobID, timerID, $('#create-project-progress-timing').empty(); } $('#create-project-progress-message').text(progress.message); + $('#create-project-progress-memory').text("Heap usage: "+progress.memory+'/'+progress.maxmemory+"MB"); } }, "json"