From: jprocter Date: Mon, 30 Jun 2008 09:50:13 +0000 (+0000) Subject: timing of 'on load' output before any gui thread operations X-Git-Tag: Release_2_4~90 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9d8d94660cfba31f6dd39cd6a8a25e3e88284277;p=jalview.git timing of 'on load' output before any gui thread operations --- 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(); + } }