50
50
import javax .management .ReflectionException ;
51
51
import javax .swing .SwingUtilities ;
52
52
import javax .swing .Timer ;
53
+ import org .graalvm .visualvm .core .datasupport .Stateful ;
53
54
import org .graalvm .visualvm .lib .common .ProfilingSettings ;
54
55
import org .graalvm .visualvm .lib .jfluid .results .memory .SampledMemoryResultsSnapshot ;
55
- import org .openide .util .Exceptions ;
56
56
import org .openide .util .NbBundle ;
57
57
58
58
/**
@@ -188,6 +188,9 @@ public void run() {
188
188
if (!timer .isRunning ()) return ;
189
189
doRefreshImplImpl (takeHeapHistogram (), views );
190
190
} catch (Exception e ) {
191
+ if (application .getState () == Stateful .STATE_AVAILABLE ) {
192
+ e .printStackTrace ();
193
+ }
191
194
terminate ();
192
195
}
193
196
}
@@ -197,21 +200,10 @@ public void run() {
197
200
}
198
201
}
199
202
200
- private TruffleHeapHistogram takeHeapHistogram () {
201
- try {
202
- Map <String , Object >[] histo = histogramProvider .heapHistogram ();
203
-
204
- return new TruffleHeapHistogram (histo );
205
- } catch (InstanceNotFoundException ex ) {
206
- Exceptions .printStackTrace (ex );
207
- } catch (MBeanException ex ) {
208
- Exceptions .printStackTrace (ex );
209
- } catch (ReflectionException ex ) {
210
- Exceptions .printStackTrace (ex );
211
- } catch (IOException ex ) {
212
- Exceptions .printStackTrace (ex );
213
- }
214
- return null ;
203
+ private TruffleHeapHistogram takeHeapHistogram () throws InstanceNotFoundException , MBeanException , ReflectionException , IOException {
204
+ Map <String , Object >[] histo = histogramProvider .heapHistogram ();
205
+
206
+ return new TruffleHeapHistogram (histo );
215
207
}
216
208
217
209
private void doRefreshImplImpl (final TruffleHeapHistogram heapHistogram , final MemoryView ... views ) {
0 commit comments