From 9d8d94660cfba31f6dd39cd6a8a25e3e88284277 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 30 Jun 2008 09:50:13 +0000 Subject: [PATCH] timing of 'on load' output before any gui thread operations --- src/jalview/io/FileLoader.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 3a77b73..584840e 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -405,15 +405,11 @@ public class FileLoader implements Runnable } loadtime += System.currentTimeMillis(); - if (Desktop.instance != null) - { - Desktop.instance.stopLoading(); - } // System.gc(); memused = memused - (rt.maxMemory() - rt.totalMemory() + rt.freeMemory()); // difference in free memory after load - if (alignFrame != null) + if (Desktop.desktop != null && Desktop.desktop.isShowMemoryUsage()) { - if (Desktop.desktop != null && Desktop.desktop.isShowMemoryUsage()) + if (alignFrame != null) { AlignmentI al = alignFrame.getViewport().getAlignment(); @@ -421,8 +417,18 @@ public class FileLoader implements Runnable + (loadtime / 1000.0) + "s, took an additional " + (1.0 * memused / (1024.0 * 1024.0)) + " MB (" + al.getHeight() + " seqs by " + al.getWidth() + " cols)"); + } else { + // report that we didn't load anything probably due to an out of memory error + System.out.println("Failed to load '"+title+"' in " + + (loadtime / 1000.0) + "s, took an additional " + + (1.0 * memused / (1024.0 * 1024.0)) + " MB (alignment is null)"); } } + // remove the visual delay indicator + if (Desktop.instance != null) + { + Desktop.instance.stopLoading(); + } } -- 1.7.10.2